OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.
geturl() creates incorrect WMS Key Value Pair (KVP) syntax.
The WMS specification tells us:
A URL prefix is defined as an opaque string including the protocol, hostname,
optional port number, path, a question mark '?', and, optionally, one or more server specific
parameters ending in an ampersand '&'.
A client appends the necessary request parameters as
name/value pairs in the form "name=value&". The resulting URL shall be valid
according to the HTTP Common Gateway Interface standard [CGI], which mandates the
presence of '?' before the sequence of query parameters and the '&' between each
parameter.
The URL prefix shall end in either a '?' (in the absence of additional server-specific
parameters) or a '&'.
So we should have a URL like:
http://host[:port]/path?{name[=value]&}
Using the following code as an example we can see that we don't get a closing ampersand instead the key (name) / value pairs seem to be added with a starting ampersand, so we get a double && when parameters are appended to the advertised service URL
geturl() creates incorrect WMS Key Value Pair (KVP) syntax.
The WMS specification tells us:
So we should have a URL like:
http://host[:port]/path?{name[=value]&}
Using the following code as an example we can see that we don't get a closing ampersand instead the key (name) / value pairs seem to be added with a starting ampersand, so we get a double && when parameters are appended to the advertised service URL
i.e.
...?language=eng&&service=WMS
The generated URLs are:
http://ogc.bgs.ac.uk/cgi-bin/BGS_AGS_EN_Bedrock_and_Structural_Geology/wms?language=eng&&service=WMS&version=1.3.0&request=GetMap&layers=AFG_AGS_1M_BLS&styles=&width=1205&height=735&crs=EPSG%3A32641&bbox=180307%2C2977040.0%2C1756900.0%2C4610100.0&format=image%2Fpng&transparent=TRUE&bgcolor=0xFFFFFF&exceptions=XML
http://ogc.bgs.ac.uk/cgi-bin/BGS_AGS_EN_Bedrock_and_Structural_Geology/wms?language=eng&&service=WMS&version=1.1.1&request=GetMap&layers=AFG_AGS_1M_BLS&styles=&width=1205&height=735&srs=EPSG%3A32641&bbox=180307%2C2977040.0%2C1756900.0%2C4610100.0&format=image%2Fpng&transparent=TRUE&bgcolor=0xFFFFFF&exceptions=application%2Fvnd.ogc.se_xml