[QGIS-Developer] "GetMap" URL from WMS layers

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue Mar 31 07:54:08 PDT 2020

Try Richard's great 'QGIS Network Logger' plugin, to see all WMS 
requests.  I've recorded several options here to grab the GetMap url: 


Jeff McKenna
MapServer Consulting and Training Services

On 2020-03-31 11:37 a.m., Jakob Miksch wrote:
> Dear list,
> I want to extract the "GetMap" URL from WMS layers. For most of the WMS 
> layers I can extract it from "layer.source()". However this does not 
> work for WMS layers where "GetMap" and "GetCapabilities" is different. 
> Like for this layer: 
> https://www.geoportal.rlp.de/mapbender/php/wms.php?inspire=1&layer_id=69694&withChilds=1&INSPIRE=1& 
> The only place where I can find the "GetMap" URL is inside the 
> "layer.htmlMetadata()" document. From there the URL can be extracted 
> using REGEX. But every localization of QGIS (e.g. German, French ...) 
> have different terms for the surrounding "GetMap" HTML element. This 
> makes this approach quite tricky.
> Is there any more elegant solution how to retrieve the "GetMap" URL from 
> WMS layers?
> Thanks in advance and best wishes,
> Jakob

More information about the QGIS-Developer mailing list