OWSLib
OWSLib copied to clipboard
WFS 2.0 URL building
In WFS 2.0 GetFeature requests currently fail for MapServer URLs containing ?map=path/my.map&
This is the same issue as #533 - and unfortunately I missed that there was also an open pull request at #534 from @samtux
The approach in this pull request is slightly different - it reuses the build_get_url
function from utils.
A few other notes:
- There is a warning about
owslib\util.py:561: DeprecationWarning: cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead
so this has been updated - the WFS GetFeature URL building allowed for the doseqparameter to be used (I'm not sure when this applies to WFS requests, but I added it to avoid any breaking changes). It allows for automatic duplicate keys for sequences e.g.
>>> urllib.urlencode({'keys': [1,2]}, doseq=True)
>>> 'keys=1&keys=2'
>>> urllib.urlencode({'keys': [1,2]}, doseq=False)
>>> 'keys=%5B1%2C+2%5D'
- I 've also added tests for the
doseq
and URLs with ampersands
Test fails for same reason as with my PR #613 for #587 initially:
tests/test_wfs3_pygeoapi.py::test_wfs3_pygeoapi FAILED
has nothing to do with your PR, but a recent change in pygeoapi
and its demo server used in tests.