0

I would like to use ogr2ogr to transform an input GML to WKT CSV, and from EPSG:27700 to EPSG:4326.

This is my command:

 ogr2ogr -f CSV output.csv input.gml -sql "select id as gmlid, OGR_GEOM_WKT as geom from layer" -s_srs EPSG:27700 -t_srs EPSG:4326

It transforms the file to CSV just fine, but the WKT content is still EPSG:27700.

Do I need to do this as two separate steps? Or perhaps I need to do the transformation as part of the SQL command? Interested in why it's not working.

  • 1
    I would like something like ogr2ogr -f CSV output.csv input.gml -dialect sqlite -sql "select id as gmlid, ST_AsText(ST_Transform(geometry,4326)) as geom from layer". GML geometries must contain srsName or otherwise GDAL can't recognize the source SRS. – user30184 Sep 22 '18 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.