Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contours without sld #54

Open
ghansham opened this issue May 16, 2020 · 12 comments
Open

contours without sld #54

ghansham opened this issue May 16, 2020 · 12 comments

Comments

@ghansham
Copy link

Is there a way to configure contour color and contour levels without sld.
It used to work in ncWMS1.

@guygriffiths
Copy link
Collaborator

It depends what you mean by "without sld". You can define new custom styles and put them in .ncWMS2/.styles as described here: https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/06-development.html#styles

The styles are written in SLD, but you don't need to pass SLD_BODY as a WMS argument to use them - they are just new named styles.

But there is currently no way of specifying contour options as WMS arguments.

@ghansham
Copy link
Author

ghansham commented May 19, 2020 via email

@guygriffiths
Copy link
Collaborator

Yes. If you want different contour styles, you need to define them in SLD and add them to .ncWMS2/.styles. Here's an example: https://github.com/Reading-eScience-Centre/edal-java/blob/master/graphics/src/main/resources/styles/colored_contours.xml

@ghansham
Copy link
Author

ghansham commented May 19, 2020 via email

@guygriffiths
Copy link
Collaborator

No, the available placeholders are listed here: https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/06-development.html#styles

@ghansham
Copy link
Author

ghansham commented May 19, 2020 via email

@guygriffiths
Copy link
Collaborator

If you want to set them dynamically, then yes you'll either have to set SLD_BODY or SLD. The latter is usually a better option, since some older browsers have a character limit on URLs.

@ghansham
Copy link
Author

ghansham commented May 19, 2020 via email

@guygriffiths
Copy link
Collaborator

I'm not sure what you mean. If you specify SLD_BODY in the URL, you don't have placeholders, you fill in the values you want. The example I attached earlier should work - you just need to replace all of the placeholders starting with $ with concrete values, and put it in the URL as SLD_BODY. It replaces LAYERS and STYLES so you don't need them.

@ghansham
Copy link
Author

ghansham commented May 19, 2020 via email

@guygriffiths
Copy link
Collaborator

If you create a style template in .styles, it will appear as a supported style name. You specify the template name as STYLES=mycontourstyle. This is how all of the included styles are defined (see https://github.com/Reading-eScience-Centre/edal-java/tree/master/graphics/src/main/resources/styles). When you do that, the placeholders listed here:
https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/06-development.html#styles
come from the URL arguments with the same names. For example $numColorBands comes from the NUMCOLORBANDS URL argument.

If this is not sufficient (e.g. you want more placeholder values) then you use SLD_BODY to specify the full SLD document. You can write a complete XML style in the SLD_BODY URL argument. There are no placeholders. You write the XML with the values you want.

@ghansham
Copy link
Author

ghansham commented May 19, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants