TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.17k stars 362 forks source link

presentation of values outside minmax range from ncWMS #4069

Open gajowi opened 4 years ago

gajowi commented 4 years ago

Terria displays pixels from outside the requested range as black. I'm working with Juan Guerschman and Bis Biswati on some netcdf files served as wms from ncWMS and they would prefer displaying the min and max 'saturation' colour. We see that godiva3 handles this with extra wms query parameters and a UI toggle to choose between black, transparent and saturate/extend.

  1. could you change/set defaults when using ncWMS

  2. could you extend the UI to suport choosing the saturation behaviour.

juan-guerschman commented 4 years ago

following

meh9 commented 4 years ago

@gajowi would be great to have the extra params godiva3 uses here so we know where to start looking :)

juan-guerschman commented 4 years ago

example:

https://data-cbr.csiro.au/ncWMS2/wms/lds/testdata/nc/coads_climatology.nc?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLES=default-scalar%2Fdefault&LAYERS=lds%2Ftestdata%2Fnc%2Fcoads_climatology.nc%2FAIRT&TIME=0000-12-16T01%3A20%3A06.000Z&COLORSCALERANGE=-43.5%2C29.95&NUMCOLORBANDS=250&ABOVEMAXCOLOR=extend&BELOWMINCOLOR=extend&BGCOLOR=extend&LOGSCALE=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&BBOX=-171.36,-90,-48.48,32.88&WIDTH=256&HEIGHT=256

the extra params that would be very useful to have are ABOVEMAXCOLOR=extend&BELOWMINCOLOR=extend&BGCOLOR=extend

If those are not passed (current behaviour in Terria) the default is to show black and it's a horrible solution. Example: https://map.geo-rapp.org/#share=s-vFU5mInmBfz8TBoHE2YygrqqeWL

gajowi commented 4 years ago

So I hear this is handled already... Is that (only) for catalogued datasets where there is extra config data? I was thinking of the 'my data' case from an arbitrary wms service. Is there documentation? (2 questions).

Gareth

On Wed, Feb 26, 2020 at 9:28 AM Juan Guerschman notifications@github.com wrote:

example:

https://data-cbr.csiro.au/ncWMS2/wms/lds/testdata/nc/coads_climatology.nc?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLES=default-scalar%2Fdefault&LAYERS=lds%2Ftestdata%2Fnc%2Fcoads_climatology.nc%2FAIRT&TIME=0000-12-16T01%3A20%3A06.000Z&COLORSCALERANGE=-43.5%2C29.95&NUMCOLORBANDS=250&ABOVEMAXCOLOR=extend&BELOWMINCOLOR=extend&BGCOLOR=extend&LOGSCALE=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&BBOX=-171.36,-90,-48.48,32.88&WIDTH=256&HEIGHT=256

the extra params that would be very useful to have are ABOVEMAXCOLOR=extend&BELOWMINCOLOR=extend&BGCOLOR=extend

If those are not passed (current behaviour in Terria) the default is to show black and it's a horrible solution. Example: https://map.geo-rapp.org/#share=s-vFU5mInmBfz8TBoHE2YygrqqeWL

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TerriaJS/terriajs/issues/4069?email_source=notifications&email_token=AAUSKFKUHIBDB3VYGY62WFDREWLQLA5CNFSM4KZ7XQ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM5YRNY#issuecomment-591104183, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUSKFN7J6RCLUZN54TFRQTREWLQLANCNFSM4KZ7XQ6Q .

rowanwins commented 4 years ago

Hi @gajowi

For a configured item you can do something like

{
    "type": "wms",
    "url": "https://data-cbr.csiro.au/ncWMS2/wms/lds/testdata/nc/coads_climatology.nc",
    "parameters": {           <---- this is the key bit to add
        "abovemaxcolor": "extend",
        "belowmincolor": "extend",
        "bgcolor": "extend"
    }
}

This info is available via the documentation here.

When adding a WMS via "My Data" the options are pretty much restricted to specifying the URL, it's hard to see that changing in the near future although it's not out of the realm of impossibility.

Cheers Rowan