OWSLib icon indicating copy to clipboard operation
OWSLib copied to clipboard

WFS 2.0 URL building

Open geographika opened this issue 5 years ago • 2 comments

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

geographika avatar Oct 09 '19 07:10 geographika

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.

justb4 avatar Oct 10 '19 10:10 justb4

Coverage Status

Coverage: 59.054% (-0.01%) from 59.063% when pulling 5eab32646abc4c07ea6c236773c1c786bd0c20fc on geographika:url-fix into a3651016a3b2d916a762c5446b6c29b0561bc754 on geopython:master.

coveralls avatar Feb 13 '23 21:02 coveralls