Reading-eScience-Centre / edal-java

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

GetLegendGraphic STYLES should be optional? #81

Closed rsignell-usgs closed 7 years ago

rsignell-usgs commented 7 years ago

After discussion with @kring, it seems that the issue I reported as a TerriaJS issue is likely a edal-java issue.

The TerriaJS GetLegendGraphic request: 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 returns the response:

<ServiceException>
You must specify either SLD, SLD_BODY or LAYERS and STYLES for a full legend. You may set COLORBARONLY=true to just generate a colour bar
</ServiceException>

Yet, looking in the WMS spec, section 10.2.1, Table 8 shows that STYLES is optional: 2017-01-19_19-44-15

guygriffiths commented 7 years ago

OK, the trouble was that STYLES is supposed to be mandatory for GetMap requests and we were using the same code. I've relaxed that restriction, so GetMap requests will still work if STYLES is missing. I guess technically it's not what a WMS should do, but I can't imagine a client which would rely on GetMap failing if STYLES is not present...