Reputation: 1
Please advise how to leverage GetCapabilities to add a legend to a layer in folium.
The WMS service has the following capabilities: https://data.geopf.fr/wms-v/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
source: https://www.geoportail-urbanisme.gouv.fr/services/
I am adding a layer as follows (but I don't know how to add a legend):
m = folium.Map(tiles='CartoDBPositron', location=(52.052515, 10.025593), zoom_start=4, )
folium.raster_layers.WmsTileLayer(
url='https://data.geopf.fr/wms-v/ows?',
name='zone_secteur',
fmt="image/png",
layers="zone_secteur",
attr=u"Institut national de l'information géographique et forestière",
overlay=True,
transparent=True,
control=True,
show=False,
).add_to(m)
I expected to see urban zones (zone_secteur or zone_urba_du) from one of the layers from this map: https://www.geoportail-urbanisme.gouv.fr
Please advise how to add a layer-legend in folium using this URL:
GetCapabilities shows this URL
<LegendURL width="20" height="20">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://data.geopf.fr/wms-v/ows?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=BU.Building"/>
</LegendURL>
Upvotes: 0
Views: 137