Reading-eScience-Centre / ncwms

ncWMS - A Web Map Service for displaying environmental data over the web
Other
62 stars 30 forks source link

Horizontal Colorbars? #88

Closed jbzambon closed 2 years ago

jbzambon commented 2 years ago

Is it possible to have horizontal colorbars? I've tried several options that don't seem to work in the WMS requests...

&LEGEND_OPTIONS=layout:horizontal

The closest I've gotten is using colorbaronly=true but then there are no values to associate with the colorbar.

http://localhost:8080/ncWMS2/wms?request=GetLegendGraphic&height=100&width=800&numcolorbands=250&colorbaronly=true&vertical=false&palette=default

Setting colorbaronly to false gives me the following error

You must specify either SLD, SLD_BODY, LAYERS and STYLES, or LAYER and STYLE for a full legend. You may set COLORBARONLY=true to just generate a colour bar

Setting these parameters overrides the vertical=false flag somehow?

http://localhost:8080/ncWMS2/wms?REQUEST=GetLegendGraphic&height=100&width=800&numcolorbands=250&vertical=false&palette=default&LAYERS=0/v&STYLES=default-scalar/default

Thanks in advance!

guygriffiths commented 2 years ago

Sorry, no, it's possible to generate a colourbar in either orientation, but the full legend with labels etc. is only available in vertical orientation.

ghansham commented 2 years ago

I modified the codebase to try this: See these links:

Horizontal Orientation: https://rapid.imd.gov.in/r2wms/wms?&request=GetLegendGraphic&style=default/insat_brt&COLORSCALERANGE=185,365&WIDTH=20&HEIGHT=350&LAYERS=3DIMG_L1B_STD4/IMG_TIR1_TEMP2D&BELOWMINCOLOR=extend&ABOVEMAXCOLOR=extend&vertical=false

Vertical Orientation: https://rapid.imd.gov.in/r2wms/wms?&request=GetLegendGraphic&style=default/insat_brt&COLORSCALERANGE=185,365&WIDTH=20&HEIGHT=350&LAYERS=3DIMG_L1B_STD4/IMG_TIR1_TEMP2D&BELOWMINCOLOR=extend&ABOVEMAXCOLOR=extend&vertical=true

This works for single band datasets at least.

regards Ghansham

On Thu, Mar 17, 2022 at 3:59 PM Guy Griffiths @.***> wrote:

Sorry, no, it's possible to generate a colourbar in either orientation, but the full legend with labels etc. is only available in vertical orientation.

— Reply to this email directly, view it on GitHub https://github.com/Reading-eScience-Centre/ncwms/issues/88#issuecomment-1070764598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYXFJAZ7LE6MCLGPZLZ4SLVAMCQTANCNFSM5Q4V7HYA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

jbzambon commented 2 years ago

Thanks much, @ghansham and @guygriffiths! Feel free to close this out.