geopython / OWSLib

OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.
https://owslib.readthedocs.io
BSD 3-Clause "New" or "Revised" License
390 stars 276 forks source link

Key Error on WMS #845

Closed rhodges closed 1 year ago

rhodges commented 2 years ago

I'm getting errors when trying to connect to NOAA's ERDDAP via OWSLib's WebMapService tool:

> from owslib.wms import WebMapService
> wms = WebMapService(url='https://coastwatch.pfeg.noaa.gov/erddap/wms/erdMBsstdmday_LonPM180/request', version='1.3.0')
*** KeyError: '{http://www.w3.org/1999/xlink}href'
> wms = WebMapService(url='https://coastwatch.pfeg.noaa.gov/erddap/wms/erdMBsstdmday_LonPM180/request', version='1.1.1')
*** KeyError: '{http://www.w3.org/1999/xlink}href'

Python version: 3.8.10 owslib version: 0.27.2

GetCapabilities seems to work as expected and I can view layers pulled from this services using OpenLayers.

Any ideas if the issue is related to my request, the service, or internal to OWSLib?

tomkralidis commented 1 year ago

The NOAA ERDDAP WMS defines an incorrect xlink namespace URI:

xmlns:xlink="https://www.w3.org/1999/xlink"

The correct namespace URI should be:

xmlns:xlink="http://www.w3.org/1999/xlink"

The WMS needs to be fixed per above.