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

Python Exception on QGIS with GDAL < 2.2 #74

Closed rduivenvoorde closed 3 years ago

rduivenvoorde commented 6 years ago

Hi, without any knowledge testing out this promissing plugin here, so bear with me for my ignorance :-)

Running QGIS here on Debian Testing which has standard gdal 2.1.2 installed (will compile gdal now myself....) When trying to run the plugin by selecting a WFS, all seems to go OK untill you see:

An error has occurred while executing Python code: 

RuntimeError: GMLAS:/tmp/tmp3k1ah3aq.gml: No such file or directory 
Traceback (most recent call last):
  File "/home/richard/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gml_application_schema_toolbox/gui/import_gmlas_panel.py", line 156, in on_loadLayersButton_clicked
    self.validate()
  File "/home/richard/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gml_application_schema_toolbox/gui/import_gmlas_panel.py", line 164, in validate
    data_source = self.gmlas_datasource()
  File "/home/richard/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gml_application_schema_toolbox/gui/import_gmlas_panel.py", line 149, in gmlas_datasource
    open_options=openOptions)
  File "/usr/lib/python3/dist-packages/osgeo/gdal.py", line 2943, in OpenEx
    return _gdal.OpenEx(*args, **kwargs)
RuntimeError: GMLAS:/tmp/tmp3k1ah3aq.gml: No such file or directory

The file '/tmp/tmp3k1ah3aq.gml' is there by the way (but if I understand correctly, probably opened by the gml driver, and not by the gmlas one)? This has probably to do with gdal 2.1 not knowing about the GMLAS prefix? Maybe adding a check/warning for gdal >= 2.2 for those using older version of GDAL?

sgrellet commented 6 years ago

Hi Richard, Thank you for looking at the plugin Stupid question, do you (or the user launching QGIS ) have the relevant credentials under /tmp/ ? Another way would be to run directly gdal command an check whether you have the same type of errors. Sylvain

rduivenvoorde commented 6 years ago

@sgrellet credentials? You mean the gml file?

Yes, the gml is there, and I think it is 'just' my version of GDAL:

[richard@oost tmp]$ ogrinfo tmp3k1ah3aq.gml
Had to open data source read-only.
INFO: Open of `tmp3k1ah3aq.gml'
      using driver `GML' successful.

[richard@oost tmp]$ ogrinfo --version
GDAL 2.1.2, released 2016/10/24
sgrellet commented 6 years ago

ok indeed http://www.gdal.org/drv_gmlas.html comes is available in GDAL >= 2.2 so GMLAS prefix is unknown to 2.1

Guts commented 3 years ago

Invalid because the mentioned GDAL version is not supported here.

Note: add to the doc the minimal requirements.