Open rsignell-usgs opened 7 years ago
This server's implementation of GetLegendGraphic
is non-standard in two ways:
STYLE
be specified.LAYERS
instead of the standard LAYER
.We could address the first by always including STYLE
in the GetLegendGraphic
request (currently we onyl include it if the user has specified one).
For the second, we either need to detect the type of server we're dealing with, or always pass both LAYER and LAYERS.
A possible workaround is to specify both STYLE
and LAYERS
in the parameters
part of the catalog item definition.
@guygriffiths, could ncWMS2 also accept LAYER
?
GetLegendGraphic
is not in the WMS standard at all, but our implementation is slightly different from that of Geoserver. I can add LAYER
as an alternative to LAYERS
- it'll be in the next release.
@guygriffiths excellent! When you do that PR, can you put in there "fixes https://github.com/TerriaJS/terriajs/issues/2338", (or maybe that doesn't work across repos...)
GetLegendGraphic is not in the WMS standard at all, but our implementation is slightly different from that of Geoserver.
Right, that's true, GetLegendGraphic
is named but not specified in WMS 1.1.1, and is not even named in WMS 1.3.0. It's part of SLD, though, which is referenced by both WMS specifications. And the SLD spec does say layer
not layers
:
http://www.opengeospatial.org/standards/sld
(see section 10.2.1 in the 1.1.0 version of the spec)
When I add a categorical data variable from ncWMS2, such as: http://gamone.whoi.edu/ncWMS/wms?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0 then: Inundation_hampton=>flood_index (or just go to: http://tinyurl.com/ztenh99) I don't get a legend:
TerriaJS is requesting: http://gamone.whoi.edu/ncWMS/wms?service=WMS&version=1.1.0&request=GetLegendGraphic&format=image%2Fpng&transparent=True&layer=Inundation_hampton%2Fflood_index&colorscalerange=-50%2C50
But the successful request is: http://gamone.whoi.edu/ncWMS/wms?STYLES=default-categorical&LAYERS=Inundation_hampton/flood_index&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic