Reading-eScience-Centre / edal-java

Environmental Data Abstraction Layer libraries
Other
39 stars 30 forks source link

Would it be possible to also advertise palettes as styles, as in ncWMS? #86

Open rsignell-usgs opened 7 years ago

rsignell-usgs commented 7 years ago

As discussed here https://github.com/TerriaJS/terriajs/issues/2200, generic WMS clients do not see the list of palettes advertised as styles, as ncWMS2 palettes are accessed through a custom getMetadata call.

Would it be possible to also allow ncWMS2 service providers to advertise the palettes as styles also, or at least some subset of palettes?

This would allow workflows like this TerriaJS one to work a lot more nicely: 2017-04-18_13-12-12

You can access this TerriaJS example workflow accessing ncWMS2 here: http://tinyurl.com/k2o8yyn

@yosoyjay and @kwilcox, would this be something you might be able to tackle, if it sounds reasonable?

yosoyjay commented 7 years ago

Just to be clear, you'd like to be able to advertise the available palettes via the GetCapabilities call even though it may be a bit tricky to parse?

On Tue, Apr 18, 2017 at 10:14 AM, Rich Signell notifications@github.com wrote:

As discussed here TerriaJS/terriajs#2200 https://github.com/TerriaJS/terriajs/issues/2200, generic WMS clients do not see the list of palettes advertised as styles, as ncWMS2 palettes are accessed through a custom getMetadata call.

Would it be possible to also allow ncWMS2 service providers to advertise the palettes as styles also, or at least some subset of palettes?

This would allow workflows like this TerriaJS one to work a lot more nicely: [image: 2017-04-18_13-12-12] https://cloud.githubusercontent.com/assets/1872600/25143506/b9449ab8-2438-11e7-890c-b47fb94b33fb.jpg

You can access this TerriaJS example workflow accessing ncWMS2 here: http://tinyurl.com/k2o8yyn

@yosoyjay https://github.com/yosoyjay and @kwilcox https://github.com/kwilcox, would this be something you might be able to tackle, if it sounds reasonable?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Reading-eScience-Centre/edal-java/issues/86, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ6N4CZEBEihLBlRF4W17JpqQyQrKg_ks5rxO9fgaJpZM4NAoww .

adamsteer commented 7 years ago

I think Rich might be saying 'advertise palettes the old ncWMS way' as a list of styles available on the server, because the ncWMS 2 way is tricky to parse

eg ncWMS (old):

Total Magnetic Intensity (TMI) Grid of Australia 2015 - sixth edition mag_tmi_anomaly magnetic_total_magnetic_intensity_anomaly magnetic_total_magnetic_intensity_anomaly ... ...all the available styles... On 19 April 2017 at 05:22, Jesse Lopez wrote: > Just to be clear, you'd like to be able to advertise the available palettes > via the GetCapabilities call even though it may be a bit tricky to parse? > > On Tue, Apr 18, 2017 at 10:14 AM, Rich Signell > wrote: > > > As discussed here TerriaJS/terriajs#2200 > > , generic WMS clients > > do not see the list of palettes advertised as styles, as ncWMS2 palettes > > are accessed through a custom getMetadata call. > > > > Would it be possible to also allow ncWMS2 service providers to advertise > > the palettes as styles also, or at least some subset of palettes? > > > > This would allow workflows like this TerriaJS one to work a lot more > > nicely: > > [image: 2017-04-18_13-12-12 <13%2012%2012>] > > 2438-11e7-890c-b47fb94b33fb.jpg> > > > > You can access this TerriaJS example workflow accessing ncWMS2 here: > > http://tinyurl.com/k2o8yyn > > > > @yosoyjay and @kwilcox > > , would this be something you might be able > > to tackle, if it sounds reasonable? > > > > — > > You are receiving this because you were mentioned. > > Reply to this email directly, view it on GitHub > > , or > mute > > the thread > > AAJ6N4CZEBEihLBlRF4W17JpqQyQrKg_ks5rxO9fgaJpZM4NAoww> > > . > > > > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . > -- Adam Steer http://au.linkedin.com/in/adamsteer +61 427 091 712 skype: adam.d.steer
adamsteer commented 7 years ago

dang, need to add the second half! Thanks early morning fingers..

vs ncWMS2:

FVCOM-NECOFS-GOM3/y y nodal y-coordinate -75.68433380126953 -56.850791931152344 35.27653121948242 46.14595031738281 ...only one or two more styles

...which lists a subset of available styles, where Rich wants to see all the styles/colourmaps available per layer (like old ncWMS) in a front end UI.

I can see how limiting styles per layer is a sane decision - it's also a thing in Geoserver, which has different constraints (for example it doesn't make sense to apply a line style to a raster).

I don't know whether it's ultimately worthwhile or not - adding a getmetadata query to TerriaJS is likely not super difficult. Although needing to parse JSON for the metadata response, and XML for all the other stuff is a bit odd.

Not sure if I've helped :/

Regards

Adam

On 19 April 2017 at 06:10, adam steer adam.d.steer@gmail.com wrote:

I think Rich might be saying 'advertise palettes the old ncWMS way' as a list of styles available on the server, because the ncWMS 2 way is tricky to parse

eg ncWMS (old):

Total Magnetic Intensity (TMI) Grid of Australia 2015 - sixth edition mag_tmi_anomaly magnetic_total_magnetic_intensity_anomaly magnetic_total_magnetic_intensity_anomaly ... ...all the available styles... On 19 April 2017 at 05:22, Jesse Lopez wrote: > Just to be clear, you'd like to be able to advertise the available > palettes > via the GetCapabilities call even though it may be a bit tricky to parse? > > On Tue, Apr 18, 2017 at 10:14 AM, Rich Signell > wrote: > > > As discussed here TerriaJS/terriajs#2200 > > , generic WMS clients > > do not see the list of palettes advertised as styles, as ncWMS2 palettes > > are accessed through a custom getMetadata call. > > > > Would it be possible to also allow ncWMS2 service providers to advertise > > the palettes as styles also, or at least some subset of palettes? > > > > This would allow workflows like this TerriaJS one to work a lot more > > nicely: > > [image: 2017-04-18_13-12-12 <13%2012%2012>] > > 25143506/b9449ab8-2438-11e7-890c-b47fb94b33fb.jpg> > > > > You can access this TerriaJS example workflow accessing ncWMS2 here: > > http://tinyurl.com/k2o8yyn > > > > @yosoyjay and @kwilcox > > , would this be something you might be able > > to tackle, if it sounds reasonable? > > > > — > > You are receiving this because you were mentioned. > > Reply to this email directly, view it on GitHub > > , or > mute > > the thread > > BEihLBlRF4W17JpqQyQrKg_ks5rxO9fgaJpZM4NAoww> > > . > > > > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . > -- Adam Steer http://au.linkedin.com/in/adamsteer +61 427 091 712 <0427%20091%20712> skype: adam.d.steer

-- Adam Steer

http://au.linkedin.com/in/adamsteer +61 427 091 712 skype: adam.d.steer

kwilcox commented 7 years ago

This was done to avoid GetCaps bloat. ncWMS1 lists out every combination of layer type and palette leading to enormous XML documents. In this case, instead of listing (4) styles per layer, you are asking to list out (372) styles per layer (4 layer types * 93 palettes).

Did you try setting the advertisedPalettes setting per the documentation? Did that work? https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/02-installation.html#servlet

rsignell-usgs commented 7 years ago

I don't need all the palettes advertised as layers, just a few favorites!

So like 12 layers instead of 4. If advertised palettes already does this, then great!

I just thought that meant advertised in the non-standard, non-layer approach.

And of course I'm not suggesting we abandon the new non-bloat approach to listing large numbers of palettes. Just that we allow a few more options for standardized clients.

Basically I just want to allow users to select the good ol' rainbow palette. 😜

adamsteer commented 7 years ago

Ah ha. Thanks for filling in there. I go the opposite way, trying hard to not let users select rainbow :)

rsignell-usgs commented 7 years ago

@kwilcox wrote:

Did you try setting the advertisedPalettes setting per the documentation? Did that work? https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/02-installation.html#servlet

@guygriffiths, would advertisedPalettes indeed allow me to address this issue?

If so, is there an example?

I tried creating a custom ncWMS.xml file as below but then my service didn't start.

<?xml version='1.0' encoding='utf-8'?>
<Context>
   <Parameter name="defaultPalette" value="x-Rainbow" override="true"/>
   <Parameter name="advertisedPalettes" value="x-Rainbow, div-BuRd" override="true"/>
</Context>
kwilcox commented 7 years ago

I'll give this a shot right now and see if I can get the setting to stick (and see what it actually does)

kwilcox commented 7 years ago

The service starts fine with a config file like so:

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <Parameter name="defaultPalette" value="div-RdBu" override="true"/>
    <Parameter name="advertisedPalettes" value="div-RdBu,div-RdBu-inv,seq-cubeYF" override="true"/>
</Context>

But does not change what is advertised in the GetCapabilities!

kwilcox commented 7 years ago

@yosoyjay I traced it down to this:

  1. GetCaps are templated from here
  2. availablePalettes seems to be set correctly here.
  3. advertisedPalettes seems to be build correctly here

Maybe the file we are creating in the docker container $CATALINA_HOME/conf/Catalina/localhost/ncWMS.xml isn't actually being picked up for Servlet context?

yosoyjay commented 7 years ago

Yeah, $CATALINA_HOME/conf/Catalina/localhost/ncWMS.xml should be $CATALINA_HOME/conf/Catalina/localhost/ncWMS2.xml

Testing now

On Wed, Apr 19, 2017 at 11:59 AM, Kyle Wilcox notifications@github.com wrote:

@yosoyjay https://github.com/yosoyjay I traced it down to this:

  1. GetCaps are templated from here https://github.com/Reading-eScience-Centre/edal-java/tree/master/wms/src/main/resources/templates
  2. availablePalettes seems to be set correctly here https://github.com/Reading-eScience-Centre/edal-java/blob/master/wms/src/main/java/uk/ac/rdg/resc/edal/wms/WmsServlet.java#L693 .
  3. advertisedPalettes seems to be build correctly here https://github.com/Reading-eScience-Centre/ncwms/blob/develop/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsServlet.java#L111-L120

Maybe the file we are creating in the docker container $CATALINA_HOME/conf/Catalina/localhost/ncWMS.xml isn't actually being picked up for Servlet context?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Reading-eScience-Centre/edal-java/issues/86#issuecomment-295392106, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ6NyKJsLWvWooHVHll60cGsOl8_JKqks5rxlmUgaJpZM4NAoww .

kwilcox commented 7 years ago

Since we deploy the webapp as ncWMS I thought it would pick this up. Can you tell I don't understand servlet containers?