Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WMS problem: 'NoneType' object has no attribute 'find' #23

Closed
SaraRT opened this issue Feb 20, 2014 · 5 comments
Closed

Add WMS problem: 'NoneType' object has no attribute 'find' #23

SaraRT opened this issue Feb 20, 2014 · 5 comments
Milestone

Comments

@SaraRT
Copy link

SaraRT commented Feb 20, 2014

Adding a WMS from a metadata using CSW it's came out this error message( see below):
An example of metadata with this problem is:
http://www.geoportale.piemonte.it/geocatalogorp/geonetworkrp/srv/it/metadata.show?id=1358
Any clue? Thanks.
errore_pluginqgis

@tomkralidis
Copy link
Member

Thanks @SaraRT. Looking deeper, MetaSearch uses OWSLib to test whether the WMS/WMTS/WFS/WCS is what it says it is, and this is where the problem happens. It appears that in this WMS's case the Capabilities XML INSPIRE definitions are giving problems to the XML parser. I also verified this using XMLSpy

@rduivenvoorde
Copy link

@tomkralidis the capabilities are valid xml isn't it? And QGIS is able to load the layers from it if I load it via the normal AddWMS route.
So is what is exactly the problem: the xml is not valid against it's own scheme? Or is it some internals of the OWSLib XML parser throwing up?
In case of the first, can we make OWSLib a litte more forgiving?

@SaraRT
Copy link
Author

SaraRT commented Feb 27, 2014

Hi,
we checked our problematic WMS and we noticed that probably in our case the problem is linked to the presence of this tag: "wms_inspire_capabilities" "embed" for the use of multi language options.

@tomkralidis
Copy link
Member

@rduivenvoorde: it's being thrown out by OWSLib. As well, the XML is not valid. Here is exactly what is happening in OWSLib:

>>> from owslib.wms import WebMapService
>>> w = WebMapService('http://osgis.csi.it/ws/aera/wms_aera_limiti')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "owslib\wms.py", line 78, in __init__
    self._capabilities = reader.read(self.url)
  File "owslib\wms.py", line 618, in read
    return etree.fromstring(u.read())
  File "C:\Python27\Lib\xml\etree\ElementTree.py", line 1300, in XML
    parser.feed(text)
  File "C:\Python27\Lib\xml\etree\ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "C:\Python27\Lib\xml\etree\ElementTree.py", line 1506, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: unbound prefix: line 123, column 4

Testing in XML Spy yields similar errors. The WMS XML is just problematic.

Having said this, MetaSearch does an OWSLib check to smoke test that the URL is what the metadata says it is by doing a GetCapabilities request and parsing it. It looks like the Add WMS dialogue in QGIS proper is not doing the same amount of checking.

We could lift this checking, but then all responsibility goes to the OWS provider dialogues. Thoughts?

@tomkralidis tomkralidis added this to the 0.3.0 milestone Mar 21, 2014
@tomkralidis
Copy link
Member

@SaraRT / @LukeGIS this is now fixed in master. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants