Hi all,
I’ve come across an issue with broken URLs in the LegendURL element of WMTS GetCapabilities statements for styles with a custom legend. The URLs provided comprise the root URL of the service appended with the name of the image file for the custom legend, e.g.
<Style isDefault="true">
<ows:Identifier>raster_test_custom_layer</ows:Identifier>
<LegendURL format="image/png" xlink:href="http://localhost:8180/custom_legend.png" width="73" height="342"/>
</Style>
The URLs don’t resolve, which is causing issues with a portal application accessing our WMTS services.
The LegendURL in the WMS GetCapabilities statement provides a GetLegendGraphic URL that works:
<LegendURL width="73" height="342">
<Format>image/png</Format>
<OnlineResource xlink:type="simple" xlink:href="http://localhost:8180/ows?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image%2Fpng&width=73&height=342&layer=nurc%3Amosaic"/>
</LegendURL>
I’m wondering if there’s a configuration in GeoServer or GeoWebCache that I’m missing, e.g. is there a way to get the WMS GetLegendGraphic URL into the WMTS GetCaps?
Tested on GeoServer 2.25.2 and 2.28.0.
Any advice would be much appreciated.
Thanks,
Aaron.