OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.
>>> from owslib.wfs import WebFeatureService
>>> wfs = WebFeatureService("http://openmaps.gov.bc.ca/geo/pub/ows?service=WFS&request=Getcapabilities", version="2.0.0")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/snorris/Projects/repo/owslib/OWSLib/owslib/wfs.py", line 57, in WebFeatureService
return wfs200.WebFeatureService_2_0_0(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/snorris/Projects/repo/owslib/OWSLib/owslib/feature/wfs200.py", line 77, in __new__
obj.__init__(
File "/Users/snorris/Projects/repo/owslib/OWSLib/owslib/feature/wfs200.py", line 130, in __init__
self._buildMetadata(parse_remote_metadata)
File "/Users/snorris/Projects/repo/owslib/OWSLib/owslib/feature/wfs200.py", line 165, in _buildMetadata
for elem in self._capabilities.find(nspath("OperationsMetadata"))[:]:
I'm using a WFS with this getcapabilites endpoint: http://openmaps.gov.bc.ca/geo/pub/ows?service=WFS&version=2.0.0&request=Getcapabilities
Curiously, it does not return valid WFS capabilities when called with this very slightly different url (note the capital
Capabilites
): http://openmaps.gov.bc.ca/geo/pub/ows?service=WFS&version=2.0.0&request=GetCapabilitiesI've alerted the provider but cannot currently use
owslib
with this service because the url gets cleaned: https://github.com/geopython/OWSLib/blob/master/owslib/util.py#L709Does
owslib
need to always stripservice
/version
/request
params from the url before making the getcapabilites request? It does seem like they might be expected when building the capabilities url: https://github.com/geopython/OWSLib/blob/master/owslib/feature/common.py#L23