I am looking for a way to automate conversion from .Shp to .Gpx. I know how to save a shapefile into gpx in a layer, but it would take too much time to do 1 by 1 as we might receive thousands of shapefiles that need conversion.

I am not very prone in coding, especially in QGIS, so does anyone have an idea or maybe even a code to make this possible with QGIS?

  • 1
    Do you have to use pyqgis or could you make use of the commandline ogr2ogr converter directly? ogr2ogr -f GPX out.gpx in.shp With a little batch scripting you can loop through the files/folder and convert everything in one. – Phil G Sep 26 at 10:48

You can do this in qgis with gdal convertformat in the processing plugin:

processing.runalg("gdalogr:convertformat","input_shp", 16, "FORCE_GPX_TRACK=YES","output_gpx")

Now for your case you have a lot of layers, all you have to do is to make it in a loop

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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