Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When i try to export an shapefile to gpx using ogr2ogr.

ogr2ogr -f GPX output.gpx D:\mypaste\input.shp -sql "SELECT Id AS name FROM layername"

It gives me the following error "Failed to create GPX file output.gpx." "GPX driver failed to create output.gpx." Does anyone knows why this happens? How can i rectify this?

share|improve this question
I thought that I would quickly solve the question for you, but I ended up confirming the same error message. I didn't have any time to dig further. – DavidF Nov 16 '12 at 5:36

For GDAL/OGR a shapefile "input.shp" contains one layer and its name is "input". The right syntax is

ogr2ogr -f GPX output.gpx D:\mypaste\input.shp -sql "SELECT Id AS name FROM input"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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