TerriaJS / terriajs

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

Allow users to auto adjust the color range on ncWMS endpoints #2199

Open rsignell-usgs opened 7 years ago

rsignell-usgs commented 7 years ago

On ncWMS endpoints, it would be very helpful to users to support the "auto adjust to color range" functionality that Godiva3 has. In the screen shot here from the Godiva3 ncWMS2 client, the user has zoomed in to a region of interest and has just clicked the button indicated:

2016-11-04_6-54-38

This triggers a call to the ncWMS extension GetMetadata&item=minmax:

http://geoport.whoi.edu/ncWMS2/wms?request=GetMetadata&item=minmax&layers=FVCOM-NECOFS-GOM3%2Ftemp&styles=default-scalar&version=1.1.1&bbox=-71.8439%2C40.8853%2C-68.9812%2C43.1754&srs=EPSG%3A4326&crs=EPSG%3A4326&time=2016-11-04T10%3A58%3A07.500Z&elevation=0&height=100&width=100

which returns the range of data for the current window as JSON:

{"min":10.68,"max":16.15}

That range is then used to redraw the tiles using the specified COLORSCALERANGE, for example

http://geoport.whoi.edu/ncWMS2/wms?FORMAT=image%2Fpng&TRANSPARENT=TRUE&STYLES=default-scalar%2Fx-Rainbow&LAYERS=FVCOM-NECOFS-GOM3%2Ftemp&TIME=2016-11-04T01%3A01%3A52.500Z&ELEVATION=0&COLORSCALERANGE=10.68%2C16.15&NUMCOLORBANDS=250&ABOVEMAXCOLOR=0x000000&BELOWMINCOLOR=0x000000&BGCOLOR=transparent&LOGSCALE=false&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&BBOX=-70.560949999993,40.936006250009,-69.583815624992,41.913140625009&WIDTH=256&HEIGHT=256

This enhancement was mentioned in https://github.com/TerriaJS/terriajs/issues/2172#issuecomment-254212932 but pulling this out a separate issue here.

rsignell-usgs commented 7 years ago

@meh9, is autoscaling the color range a need for AREMI as well?
It drives me nuts trying to click around figuring out what the color scale range should be...

meh9 commented 7 years ago

@rsignell-usgs, yeah, if it would autoscale then I wouldn't have to figure it out and pre-configure it in the catalogue, so that would certainly be nice. :)

We also had some feedback that somebody else would like it to autoscale for an ArcGIS MapServer dataset, which would be a different thing entirely again obviously.