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

Can't transform coordinates, source layer has no #19

Closed mhugo closed 7 years ago

mhugo commented 7 years ago

When trying to import https://github.com/BRGM/gml_application_schema_toolbox/blob/master/samples/BRGM_raw_database_observation_waterml2_output.xml

Maybe it lacks a way to set the source SRS ...

sgrellet commented 7 years ago

you already have the SRS

49.9506859240222 2.3597603712661
mhugo commented 7 years ago

Exact. There is something else GDAL does not like apparently ...

mhugo commented 7 years ago

@rouault apparently if 'srcSRS' is not set, the conversion keeps giving me errors and no geometries are created in the sqlite file. When I set srcSRS to 4326, it works fine.

Example script to reproduce: https://github.com/BRGM/gml_application_schema_toolbox/blob/master/tests/test_load_in_qgis.py#L36

Does that mean the input SRS must be supplied ?

rouault commented 7 years ago

If you run with gdal.VectorTranlate() with reproject = True and a dstSRS, then the source layers with geometries must have a SRS set, or it must be explictly set with srcSRS

Here the issue is that GDAL doesn't recognize the GML srs as it is set on the pos element (which is valid, but unusual) and not on the Point

Looking if I can come up with a GDAL fix

rouault commented 7 years ago

Fixed in GDAL per https://trac.osgeo.org/gdal/ticket/6962

mhugo commented 7 years ago

Thanks !

rouault commented 7 years ago

Wondering if the combo in the plugin shouldn't have an item that would completely disable reprojection ("Source SRS") ?

mhugo commented 7 years ago

I've added a 'Source SRS" button in https://github.com/BRGM/gml_application_schema_toolbox/commit/70bbd0fe61da6d18731e8d2e22b6f7dac0c1b1f5