Closed rsignell-usgs closed 8 years ago
FYI, we are working on a new python-based WMS service (sci-wms) for structured grid and unstructured mesh models that will work with this same calling syntax. https://github.com/sci-wms/sci-wms
Thanks for the suggestion @rsignell-usgs! While we don't currently have a UI for specifying extra parameters like that, it can be easily done through code / catalog files. For example, save this to a file with a .json
extension and drag/drop it into a TerriaJS app:
{
"catalog": [
{
"name": "Rich Signell's Datasets",
"type": "group",
"items": [
{
"name": "NOAA Global WaveWatch 3",
"type": "wms",
"url": "http://thredds.ucar.edu/thredds/wms/grib/NCEP/WW3/Global/Best",
"layers": "Significant_height_of_combined_wind_waves_and_swell_surface",
"parameters": {
"COLORSCALERANGE": "0.28,5.53"
}
}
]
}
]
}
A file like this can be specified by URL, too, instead of dragging/dropping. Navigate to a URL like this:
http://mymapname.map.terria.io/#http://url.to/file.above.json
Or, it can be listed in config.json.
@kring, awesome this so flexible! I tried drag-and-dropping the above json into the national map and it worked great:
I think it still would be cool to do this from the UI, so should I leave this open as an enhancement issue?
@rsignell-usgs Re color maps and grids: There is also Groundwater Visualisation project which rasterises grids inside user's GPU. That allows colormap selection. https://nicta.github.io/groundwater-viz-help/videos/part2vid.webm
I'd like it left open for reference and the conversation thread. Thanks for the feedback! @rsignell-usgs can you add a "Design" label as I am unable to attach one to this issue. Ta!
@nahidakbar, that's awesome! We recently had a project to convert MODFLOW groundwater models to NetCDF format (https://github.com/axiom-data-science/modflow2netcdf), and would love to give our models a try in this app. I'll contact you offline about this.
@hilarycinis I'm not a contributor, so I can't add a "Design" label.
Design label added.
I kind of buried my idea for solving this issue in https://github.com/TerriaJS/terriajs/issues/699, so I'm bringing it to the surface here:
Just add type-in boxes for the min and max COLORSCALERANGE
values next to the GetLegendGraphic
colorscale in the "Now Viewing" window, here:
This would allow not only user input of the COLORSCALERANGE
in a logical location (right there with other user-input parameters affecting this layer, like OPACITY
), but it could also serve as the min and max value labels for the colorscale, as in the Godiva2 client:
Note that Godiva2 requests the legend graphic using an WMS-extension COLORBARONLY
parameter:
http://thredds.ucar.edu/thredds/wms/grib/NCEP/WW3/Global/Best?REQUEST=GetLegendGraphic&COLORBARONLY=true&WIDTH=1&HEIGHT=398&PALETTE=rainbow&NUMCOLORBANDS=20
so that the labels are not returned with the graphic. This way the client can supply the labels.
Alternatively, if TerriaJS developers want to keep it simpler, could just add type-in boxes for min and max values for COLORSCALERANGE
and then request the legend adding the COLORSCALERANGE
parameter to the request, like this:
Example 1: Range [0,1]: http://thredds.ucar.edu/thredds/wms/grib/NCEP/WW3/Global/Best?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image/png&layer=Significant_height_of_combined_wind_waves_and_swell_surface&COLORSCALERANGE=0,1
Example 2: Range [0,5]: http://thredds.ucar.edu/thredds/wms/grib/NCEP/WW3/Global/Best?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image/png&layer=Significant_height_of_combined_wind_waves_and_swell_surface&COLORSCALERANGE=0,5
@RacingTadpole You interested in another bounty? I'm thinking we take @rsignell-usgs's latest suggestion (type-in boxes for min/max) as a first test. Hardest part is the code to re-run the query and update the colorscale legend.
This would be cool - but how much do you think the user needs to set the min/max if you have reasonable values in the json?
Pre-defined values work when the data is static, but for data that has dynamic ranges (climate and forecast data, in this case) users need to be able to select it themselves.
To elaborate a bit: all the servers (I know of ) that supply time dependent model output via WMS have adopted a COLORSCALERANGE
parameter that the user can control, because otherwise, the WMS images will be of limited utility.
As an example, consider displaying maps of air temperature in regions where the seasonal variation is from -5 to 30 C. If we set the min/max values in the JSON to -5 to 30 C to cover the seasonal variation, the dynamic range will be much too large to be useful to users plotting air temperature maps in summer or winter (or any time, actually).
@RacingTadpole: now a $100 bounty: https://www.bountysource.com/issues/22738770-allow-users-to-specify-colorscalerange-on-wms-requests
This is now working in https://github.com/TerriaJS/terriajs/commit/bc3bd1911812d60f7338ac49c4c3d30a3c6aa0ea.
Here's proof!
@kring , good to close as far as I'm concerned!
Fixed by #1754.
It's awesome that we can drop THREDDS WMS endpoints in the National Map, and it would be even more awesome if we could specify the color range. I know this is a non-standard WMS feature, but it's super useful for model products served via THREDDS ncWMS service. As an example, here's the NOAA Global WaveWatch 3 model significant wave height in the National Map: which doesn't show the user a whole lot because the default color range is -50,50 meters.
The National Map request currently looks like this: http://thredds.ucar.edu/thredds/wms/grib/NCEP/WW3/Global/Best?time=2015-06-18T18%3A00%3A00.000Z&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&styles=&tiled=true&service=WMS&version=1.1.1&request=GetMap&layers=Significant_height_of_combined_wind_waves_and_swell_surface&srs=EPSG%3A3857&bbox=17532819.79994059%2C-7514065.628545966%2C20037508.342789244%2C-5009377.085697312&width=256&height=256 which looks like:
but with the addition of the
COLORSCALERANGE
parameter on the end: http://thredds.ucar.edu/thredds/wms/grib/NCEP/WW3/Global/Best?time=2015-06-18T18%3A00%3A00.000Z&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&styles=&tiled=true&service=WMS&version=1.1.1&request=GetMap&layers=Significant_height_of_combined_wind_waves_and_swell_surface&srs=EPSG%3A3857&bbox=17532819.79994059%2C-7514065.628545966%2C20037508.342789244%2C-5009377.085697312&width=256&height=256&COLORSCALERANGE=0.28%2C5.53 it could look like this:It would be cool if this could be specified by the user in the interface on "layer settings" or something.