You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author Name: geo julien (@Guts)
Original Redmine Issue: 16333
Affected QGIS version: 2.14.12
Redmine category:python_plugins
Assignee: Tom Kralidis
I'm working on my plugin which can add layers from OGC services directly to Map canvas without UI step. So I use owslib with PyQGIS. Trying various WMTS sample (check my script here: https://github.com/isogeo/isogeo-plugin-qgis/blob/master/test/test_wmts.py), I've found a WMTS that works through QGIS integrated widget but not from owslib (see attached screen capture), but not from Python script.
Just with version parameter (I know, quite useless but...):
wmts = WebMapTileService("http://data.geus.dk/arcgis/rest/services/OneGeologyGlobal/S071_G2500_OneGeology/MapServer/WMTS?request=GetCapabilities", version="1.0.0")
Traceback (most recent call last):
File "", line 1, in
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\wmts.py", line 114, in __init__
self._buildMetadata(parse_remote_metadata)
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\wmts.py", line 133, in _buildMetadata
self.provider=ServiceProvider(serviceprov)
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\ows.py", line 78, in __init__
val = self._root.find(util.nspath('ProviderName', namespace))
AttributeError: 'NoneType' object has no attribute 'find'
```
With full parameters:
wmts = WebMapTileService("http://data.geus.dk/arcgis/rest/services/OneGeologyGlobal/S071_G2500_OneGeology/MapServer/WMTS?request=GetCapabilities", version="1.0.0", parse_remote_metadata=0, xml="http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS/1.0.0/WMTSCapabilities.xml")
Traceback (most recent call last):
File "", line 1, in
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\wmts.py", line 102, in __init__
self._capabilities = reader.readString(xml)
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\wmts.py", line 649, in readString
return etree.fromstring(st)
File "C:\\OSGEO4~1\\apps\\Python27\\lib\\xml\\etree\\ElementTree.py", line 1300, in XML
parser.feed(text)
File "C:\\OSGEO4~1\\apps\\Python27\\lib\\xml\\etree\\ElementTree.py", line 1642, in feed
self._raiseerror(v)
File "C:\\OSGEO4~1\\apps\\Python27\\lib\\xml\\etree\\ElementTree.py", line 1506, in _raiseerror
raise err
ParseError: not well-formed (invalid token): line 1, column 5
```
Pointing only on the XML:
```
wmts = WebMapTileService("http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS/1.0.0/WMTSCapabilities.xml")
Traceback (most recent call last):
File "", line 1, in
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\wmts.py", line 114, in __init__
self._buildMetadata(parse_remote_metadata)
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\wmts.py", line 133, in _buildMetadata
self.provider=ServiceProvider(serviceprov)
File "C:/OSGEO4~1/apps/qgis-ltr/./python\\owslib\\ows.py", line 78, in __init__
val = self._root.find(util.nspath('ProviderName', namespace))
AttributeError: 'NoneType' object has no attribute 'find'
```
Behaviors should be the same, no? (sincere question)
---
- [qgis_214_osgeo4w_owslib_wmts.png](https://issues.qgis.org/attachments/download/10822/qgis_214_osgeo4w_owslib_wmts.png) (geo julien)
The text was updated successfully, but these errors were encountered:
Author Name: geo julien (@Guts)
Original Redmine Issue: 16333
Affected QGIS version: 2.14.12
Redmine category:python_plugins
Assignee: Tom Kralidis
I'm working on my plugin which can add layers from OGC services directly to Map canvas without UI step. So I use owslib with PyQGIS. Trying various WMTS sample (check my script here: https://github.com/isogeo/isogeo-plugin-qgis/blob/master/test/test_wmts.py), I've found a WMTS that works through QGIS integrated widget but not from owslib (see attached screen capture), but not from Python script.
Just with version parameter (I know, quite useless but...):
The text was updated successfully, but these errors were encountered: