# How to convert .shp into .gpx using QGIS?

I'm newbie using QGIS. I would like to convert .shp into .gpx. So, using Qgis, I open my shapefile and I tried to "save as" gpx but it gives an OGR error:

creation of field ObjectId failed (OGR error: Field of name 'ObjectId' is not supported in GPX schema. Use GPX_USE_EXTENSIONS creation option to allow use of the <extensions> element.)

How can I fix this error?

Thanks.

-
I tried this in another PC with the same OS and it works! Andre Joost is correct! I still dont know why this works here and doesn't work in the other PC. Should i install GPX driver?? :| Thanks André Joost! –  ePascoal Nov 12 '12 at 9:16
in a situation like that, where the error mentions a parameter or setting you're not familiar with, check the related GDAL or OGR formats page for the driver you're using, e.g. GPX. In some scenarios, you won't want to blindly apply an option as it might hurt your data. Case-in-point, you would not want to indiscriminantly apply -skipfailures in ogr2ogr without researching why it's failing in the first place. –  elrobis Dec 6 '12 at 17:18

Just do what you are told: In the Data source field, enter

GPX_USE_EXTENSIONS=YES


or check "skip attribute creation" underneath (or what it is named in your language).

In the Layer field, you might also enter

FORCE_GPX_TRACK=YES


to get tracks instead of routes.

-
Thanks, it really works, but when i convert shp to gpx i lost my Id field. All my gpx fields are null. How can i correspond my "id" field(shp file) to "name" field(gpx file). –  ePascoal Nov 9 '12 at 14:26
I'm afraid this is not possible on exporting. it is possible with ogr2ogr.exe from the gdal package: ogr2ogr -f GPX -dsco GPX_USE_EXTENSIONS=NO shpexport.gpx D:\path\to\your\test.shp -lco FORCE_GPX_TRACK=YES -sql "SELECT id AS name FROM layername" –  Andre Joost Nov 9 '12 at 15:55
I understand, thanks Andre! –  ePascoal Nov 9 '12 at 16:00
You can use the table manager plugin to rename the id field in the shapefile to "name" before exporting and change it back afterwards. If necessary, you have to add pyqgis.org/repo/contributed to the list of your repositories. –  Andre Joost Nov 10 '12 at 6:15
i tried to rename the id field in shapefile to name before exporting but doesn't work. i look for an application that add an python app named PostGPS, but doesn't work. I tried with ogr2ogr using your script too without success :/ Am i doing something wrong. There is any other possible sollution? –  ePascoal Nov 11 '12 at 19:45

You can also use DNRGarmin from the Minnisota department of Natural Resources. It's a free tool and allows you to do a lot of imports and exports for GPS data

-