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

'NoneType' object has no attribute 'find' in WebMapService #840

Closed davidoesch closed 1 year ago

davidoesch commented 2 years ago

Hi OS WIN/LINUX OWSLib 0.27.2 from owslib.wms import WebMapService service = WebMapService("https://www.geoportal.ch/services/wms/ktai")

results in

Traceback (most recent call last): File "", line 1, in File "c:\venv\lib\site-packages\owslib\wms.py", line 50, in WebMapService return wms111.WebMapService_1_1_1( File "c:\venv\lib\site-packages\owslib\map\wms111.py", line 87, in init self._buildMetadata(parse_remote_metadata) File "c:\venv\lib\site-packages\owslib\map\wms111.py", line 96, in _buildMetadata self.identification = ServiceIdentification(serviceelem, self.version) File "c:\venv\lib\site-packages\owslib\map\wms111.py", line 358, in init self.type = testXMLValue(self._root.find('Name')) AttributeError: 'NoneType' object has no attribute 'find'

-> Any hints on that?

KTAI-GIS commented 1 year ago

Hi there The service should work now. Geoinfo reported the fix of the issue. But the services are still not visible under https://davidoesch.github.io/geoservice_harvester_poc/. Another problem is the visualizer who shows the data somewhere in serbia. (See example KT_ZH) Do we have to fix something more? Kind regards

davidoesch commented 1 year ago

Thanks!

davidoesch commented 1 year ago

we still have this issue for both WMS 1.3.0 and 1.1.1

service = WebMapService(https://www.geoportal.ch/services/wms/ktai?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities) or service = WebMapService(https://www.geoportal.ch/services/wms/ktai?SERVICE=WMS&VERSION=1.3.&REQUEST=GetCapabilities)

results in

Traceback (most recent call last): File "", line 1, in File "c:\temp\geoservice_harvester_poc\venv\lib\site-packages\owslib\wms.py", line 50, in WebMapService return wms111.WebMapService_1_1_1( File "c:\temp\geoservice_harvester_poc\venv\lib\site-packages\owslib\map\wms111.py", line 87, in init self._buildMetadata(parse_remote_metadata) File "c:\temp\geoservice_harvester_poc\venv\lib\site-packages\owslib\map\wms111.py", line 96, in _buildMetadata self.identification = ServiceIdentification(serviceelem, self.version) File "c:\temp\geoservice_harvester_poc\venv\lib\site-packages\owslib\map\wms111.py", line 358, in init self.type = testXMLValue(self._root.find('Name')) AttributeError: 'NoneType' object has no attribute 'find'

@KTAI-GIS did the fiy have been already deployed?

KTAI-GIS commented 1 year ago

Hi there

I got the following answer from the publisher.

Der Dienst ist erreichbar, capabilities dokument ist ebenfalls lesbar.

Laut dieser Doku sieht der Pfad von Ihnen nicht korrekt aus. https://github.com/geopython/OWSLib

WebMapService('https://www.geoportal.ch/services/wms/ktai?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities', version='1.3.0')

Dieser Aufruf gibt bei uns auch kein Ergebnis.

service = WebMapService(https://www.geoportal.ch/services/wms/ktai?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities)

Im Aufruf fehlt die Version des Parameters jedoch.

Best regards

davidoesch commented 1 year ago

Bugger me... I do now parse the version... https://github.com/davidoesch/geoservice_harvester_poc/commit/d5f5c4c35ac231789e030d2c9734af35e6cb6116 and now it works. one of the next run within 24h it will be included