2

I already have found how to import GPX files into PostgreSQL using gdal/org2org. Now I am wondering of dumping into GPX files the results of my modification on dataset stored into PostgreSQL. But I have not found how to do so. Provided I have kept the original structure of tables generated by ogr2org, how can I dump their contents into a GPX file?

1 Answer 1

4

General syntax would be something like this

ogr2ogr -f GPX output.gpx 
PG:"host=myhost user=myloginname dbname=mydbname password=mypassword"

The GPX schema only allows certain field names. You can remap field names using the -sql option.

ogr2ogr -f GPX output.gpx 
PG:"host=myhost user=myloginname dbname=mydbname password=mypassword" 
-sql "SELECT field1 AS name, field2 AS desc FROM input"

more details here: http://www.gdal.org/drv_gpx.html

1
  • Just to add, GPX only allows EPSG:4326, and does not know polygons.
    – AndreJ
    Commented Feb 14, 2016 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.