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

QGIS server WFS response not parsed by OWSLib #22246

Closed
qgib opened this issue Feb 8, 2016 · 6 comments
Closed

QGIS server WFS response not parsed by OWSLib #22246

qgib opened this issue Feb 8, 2016 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server

Comments

@qgib
Copy link
Contributor

qgib commented Feb 8, 2016

Author Name: Gavin Fleming (@gubuntu)
Original Redmine Issue: 14250
Affected QGIS version: 2.8.5
Redmine category:qgis_server
Assignee: René-Luc ReLuc


We have had to resort to parsing WFS XML responses since there seems to be some keyword case sensitivity in either QGIS server or OWSLib that's preventing unfettered OGC communication.

I wasn't able to diagnose if the problem is with QGIS or OWSLib


@qgib
Copy link
Contributor Author

qgib commented Feb 8, 2016

Author Name: Jukka Rahkonen (Jukka Rahkonen)


It would be much easier to analyze if the XML from QGIS server is valid if you could add a sample.

@qgib
Copy link
Contributor Author

qgib commented Feb 16, 2016

Author Name: René-Luc ReLuc (@rldhont)


  • assigned_to_id was configured as René-Luc ReLuc

@qgib
Copy link
Contributor Author

qgib commented Mar 29, 2016

Author Name: Gavin Fleming (@gubuntu)


GetCapabilities XML attached.

By the way, this is the response when I try to use OWSLib:
Based on the documentation, they have three WFS versions supported:

Version 1.0.0

>>> from owslib.wfs import WebFeatureService
>>> wfs11 = WebFeatureService(url='http://129.232.164.58:6003/cgi-bin/qgis_mapserv.fcgi?map=/qgis/docs/projects/straffontein_SCH032.qgs', version='1.0.0')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/owslib/wfs.py", line 36, in WebFeatureService
    timeout=timeout)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs100.py", line 72, in __new__
    obj.__init__(url, version, xml, parse_remote_metadata, timeout)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs100.py", line 94, in __init__
    self._buildMetadata(parse_remote_metadata)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs100.py", line 104, in _buildMetadata
    self.provider=ServiceProvider(serviceelem)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs100.py", line 283, in __init__
    self.keywords = extract_xml_list(self._root.find(nspath('Keywords')))
  File "/usr/local/lib/python2.7/site-packages/owslib/util.py", line 540, in extract_xml_list
    keywords = [re.split(r'[\
\
]+',f.text) for f in elements if f.text]
TypeError: 'NoneType' object is not iterable
>>> 

Version 1.1.0

>>> from owslib.wfs import WebFeatureService
>>> wfs11 = WebFeatureService(url='http://129.232.164.58:6003/cgi-bin/qgis_mapserv.fcgi?map=/qgis/docs/projects/straffontein_SCH032.qgs', version='1.1.0')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/owslib/wfs.py", line 39, in WebFeatureService
    timeout=timeout)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs110.py", line 53, in __new__
    obj.__init__(url, version, xml, parse_remote_metadata, timeout)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs110.py", line 76, in __init__
    self._buildMetadata(parse_remote_metadata)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs110.py", line 83, in _buildMetadata
    self.identification=ServiceIdentification(val,self.owscommon.namespace)
  File "/usr/local/lib/python2.7/site-packages/owslib/ows.py", line 47, in __init__
    val = self._root.find(util.nspath('Title', namespace))
AttributeError: 'NoneType' object has no attribute 'find'
>>> 

Version 2.0.0

>>> from owslib.wfs import WebFeatureService
wfs11 = WebFeatureService(url='http://129.232.164.58:6003/cgi-bin/qgis_mapserv.fcgi?map=/qgis/docs/projects/straffontein_SCH032.qgs', version='2.0.0')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/owslib/wfs.py", line 42, in WebFeatureService
    timeout=timeout)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs200.py", line 61, in __new__
    obj.__init__(url, version, xml, parse_remote_metadata, timeout)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs200.py", line 85, in __init__
    self._buildMetadata(parse_remote_metadata)
  File "/usr/local/lib/python2.7/site-packages/owslib/feature/wfs200.py", line 92, in _buildMetadata
    self.identification=ServiceIdentification(serviceidentelem)
  File "/usr/local/lib/python2.7/site-packages/owslib/ows.py", line 47, in __init__
    val = self._root.find(util.nspath('Title', namespace))
AttributeError: 'NoneType' object has no attribute 'find'
>>> 

  • 9773 was configured as GetCapabilities.xml

@qgib
Copy link
Contributor Author

qgib commented Apr 8, 2016

Author Name: René-Luc ReLuc (@rldhont)


QGIS Server only provides WFS version 1.0.0.

It seems that OWSLib is waiting for Keywords in capabilities.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • regression was configured as 0
  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Mar 9, 2019

Author Name: Giovanni Manghi (@gioman)


End of life notice: QGIS 2.18 LTR

Source:
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/


  • resolution was changed from to end of life
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Mar 9, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server
Projects
None yet
Development

No branches or pull requests

1 participant