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

We need legend labels with all the thresholds #107

Open
David-Gil opened this issue Mar 6, 2018 · 9 comments
Open

We need legend labels with all the thresholds #107

David-Gil opened this issue Mar 6, 2018 · 9 comments

Comments

@David-Gil
Copy link

We create weather probabilistic products with thresholds 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100%.

I have created a custom style with the Categorize symbolizer (taken from your answer) that takes into account those thresholds in the map.

The problem comes with the generated legend labels: it doesn't show all the thresholds next to the correspondent color. Instead, it calculates a few values (low, medLow, medHigh and high) and only shows those.

Is there a way to show all the thresholds in the legend next to their color? We're used to matplotlib, with which it is fairly easy to do.

Thank you for your time.

@guygriffiths
Copy link
Contributor

This shouldn't be too tricky to do, although I don't have a great deal of time to work on EDAL/ncWMS at the moment. What are you using which doesn't show the values? Godiva3, or a GetLegendGraphic call?

@David-Gil
Copy link
Author

I use THREDDS.

@guygriffiths
Copy link
Contributor

What client are you using - i.e. what is generating the legend? If you're not sure, can you attach a screenshot?

@geojs
Copy link
Contributor

geojs commented Mar 22, 2018

With a forked ncWMS 1.2, I did this kind of legend (wave height) with a GetLegendGraphic call:
wms

@David-Gil
Copy link
Author

I'm sorry I haven't answered until now. I have been very busy with other projects.

We get the legend with the GetLegendGraphic call. This is what I get now:

legend

@geojs has attained just what we need! The problem is that I don't know when it will be available for THREDDS (or if it will be available at all). Therefore we began making our own legends in SVG.

Anyway, I think it is a very desirable feature for future versions.

@guygriffiths
Copy link
Contributor

@David-Gil - I've just implemented this is the develop branch. Any colour schemes which define specific points will now have them labelled in the image returned from GetLegendGraphic. This will make it into the next release.

@geojs
Copy link
Contributor

geojs commented Apr 17, 2018

@guygriffiths - thanks, I changed in /ncWMS2/WEB-INF/lib/ the edal-graphics-1.4.0.jar with edal-graphics-1.4.1-SNAPSHOT.jar from develop branch.

The result with an sld using ColorMap and Categorize:
?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLE=hs&LAYERS=hs%2FHs&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic
getlegendgraphic

Is it possible to have an option (in the sld) to have the same rectangle height for each threshold ?

The colorbar only legend has the same rectangle height for each threshold:
?FORMAT=image%2Fpng&SERVICE=WMS&PALETTE=hs_palette&VERSION=1.1.1&COLORBARONLY=true&REQUEST=GetLegendGraphic&NUMCOLORBANDS=31
colorbar

@guygriffiths
Copy link
Contributor

I'll have a look into it when I have some time, but it's far from straightforward. The colorbar only legend is generating the colorbar from the palette name, which I think is only the same because you've designed your style hs from those colour values.

@David-Gil
Copy link
Author

Thank you, @guygriffiths !!

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

3 participants