2

I am looking for a software that does batch processing of shapefiles to GPX files. I have seen many including Arcmap that will batch gpx to shapefiles but none vice versa. I currently am using DNR Garmin to complete the task one file at a time but it is time consuming.

3
  • You can use arcmap interoperability extension.
    – Learner
    Commented Jan 22, 2015 at 5:55
  • 1
    If you're already using ArcMap, you could give this a try: arcgis.com/home/item.html?id=067d6ab392b24497b8466eb8447ea7eb
    – KHibma
    Commented Jan 22, 2015 at 18:46
  • The script tool works but the files will not open in Base Camp or Mapsource for some reason. I can still get them to a GPS via other sources but my entire field team uses Garmin products and getting them to switch will be quite the task. I do not have access to the interoperability extension. I have a basic license at work.
    – S. Burke
    Commented Jan 23, 2015 at 21:45

2 Answers 2

1

GDAl ogr2ogr should do what you want:

ogr2ogr -f "GPX" -t_srs EPSG:4326 out.gpx in.shp

Note that this will only work for line and point features. Polygons must be converted to lines before.

You can use it for whole directories with a FOR loop depending on your operating system.

For Windows, it should be something like

for %%N in (D:\inputfolder\*.shp) DO ogr2ogr -f "GPX" -dsco "GPX_USE_EXTENSIONS=YES FORCE_GPX_TRACK=YES" -t_srs epsg:4326 D:\outputfolder\%%~nN.gpx %%N 
pause

The creation option GPX_USE_EXTENSIONS=YES is necessary because GPX has only a limited range of allowed field names, compared to the shapefile input. FORCE_GPX_TRACK=YES will save your input linestrings into tracks instead of routes.

inputfolder and outputfolder might require quotations around if the full path contains blanks.

1
  • I have not had a chance to explore this solution yet but I will inform you of results when I do.
    – S. Burke
    Commented Jan 23, 2015 at 21:47
0

Global Mapper will batch convert many formats including .shp to .gpx.

To use it:

  1. Open Global Mapper (need it installed)
  2. Go File>Batch Convert/Reproject.
  3. When the window "Select File Type to Convert From" appears- select Shapefile, click OK.

enter image description here

  1. When the window "Select File Type to Convert To" appears - select GPX(GPS eXchange Format), click OK.

enter image description here

  1. When the "Batch Convert" Window opens, add in the files you wish to convert. For the output location, you can specify the same directory or another location to output to. When happy with the settings, click OK.

enter image description here

  1. The files will then be batched converted to the location you specified in step 5 (top 3 files are the converted shapefile in .gpx format).

enter image description here

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.