BRGM / gml_application_schema_toolbox

GML Application Schema toolbox is a QGIS plugin allowing to manipulate OGC Complex Features
https://brgm.github.io/gml_application_schema_toolbox/
GNU General Public License v2.0
28 stars 18 forks source link

AttributeError: 'Crs' object has no attribute 'split' #227

Closed frida-161 closed 2 years ago

frida-161 commented 2 years ago

Environment

Description

When I try to load a WFS in XML mode using a bounding box the error below appears.

Logs

AttributeError: 'Crs' object has no attribute 'split' 
Traceback (most recent call last):
  File "/home/t5n/.local/share/QGIS/QGIS3/profiles/HVBG/python/plugins/gml_application_schema_toolbox/gui/load_wizard_xml.py", line 55, in validatePage
    gml_path = self.wizard().gml_path()
  File "/home/t5n/.local/share/QGIS/QGIS3/profiles/HVBG/python/plugins/gml_application_schema_toolbox/gui/load_wizard.py", line 242, in gml_path
    self._wfs_page.download(gml_path)
  File "/home/t5n/.local/share/QGIS/QGIS3/profiles/HVBG/python/plugins/gml_application_schema_toolbox/gui/load_wizard_wfs.py", line 267, in download
    self.download_features(output_path)
  File "/home/t5n/.local/share/QGIS/QGIS3/profiles/HVBG/python/plugins/gml_application_schema_toolbox/gui/load_wizard_wfs.py", line 295, in download_features
    response = wfs.getfeature(**params)
  File "/usr/lib/python3.10/site-packages/owslib/feature/wfs200.py", line 293, in getfeature
    (url) = self.getGETGetFeatureRequest(
  File "/usr/lib/python3.10/site-packages/owslib/feature/__init__.py", line 216, in getGETGetFeatureRequest
    request["bbox"] = self.getBBOXKVP(bbox, typename)
  File "/usr/lib/python3.10/site-packages/owslib/feature/__init__.py", line 35, in getBBOXKVP
    srs = Crs(bbox[4])
  File "/usr/lib/python3.10/site-packages/owslib/crs.py", line 1747, in __init__
    values = self.id.split(':')
AttributeError: 'Crs' object has no attribute 'split'
frida-161 commented 2 years ago

I fixed this in my fork (https://github.com/gbd-consult/gml_application_schema_toolbox/commit/a018c0a0d8dd11c3879ea702f6dad2318a9852fe) with a String conversion. Meanwhile I found out that the extlibs/owslib_hacks.py file isn't referenced anywhere anymore. I first tried to fix it in there.