[GPSBabel] Merge multiple GPX files, only keeping tracks?

Joined
Mar 8, 2017
Messages
7
Reaction score
0
Hello

I need to merge 20-40 GPX files into a single GPX file, while removing waypoints during the process (I only need tracks).

I looked around the GPSBabel GUI application, but found nothing obvious, and the website displays nothing when clicking on either Support or Documentation.

Can the CLI application do this?

Thank you.
 
Last edited by a moderator:
Tried this, to no avail: No trace of "merge.gpx".

Open DOS box

cd "folder/of/file"

setlocal enabledelayedexpansion

set f=for %%f in (*.gpx) do set f=!f! -f "%%f"

gpsbabel -i gpx !f! -o gpx -F "merge.gpx"​

What am I doing wrong?
 
Last edited by a moderator:
There a many free programs that will allow the contents of GPX files to be merged, Garmin Basecamp is one, also the older Garmin Mapsource will do this
 
Thanks, I'll check it out.

Is there really no way to use some kind of "*.gpx" to feed multiple files into GpsBabel?
 
The problem you may get in merging GPX files, is that the GPX can contain a lot of different data, e.g. any combination of single or multiple Waypoints, Tracks and Routes, so if the GPX's contain different types of data format it may be difficult to produce a single working file, that is why I said you may have to merge the contents of the files, rather than merging the files
 
Thanks for the info.

Indeed, here's what happens after I use GpsPrune to merge GPX files into a single file, and import it in Google My Maps:

GPX.to.GMM.glitches.png

Why does this occur?

Also, why are timestamps so important in GPX files, even when users only care about the route, not speed?

--
Edit: Same issue when importing the file in GPSVisualizer, but it gets worse when importing the whole route in yet another site (www.visugpx.com):
VisuGPX.glitch.import.full.GPX.png
 
Last edited:
Are you trying to merge GPX files into a single GPX file, or merge tracks into a single track?, the first option would say, take 40 GPX files containing a single track and produce a single GPX file containing 40 separate tracks, the second would also produce a single GPX file but it would contain a single track by joining all the tracks together. You will have a problem with the second option, if, for example you had track from London to Brighton and a track from Sydney to Adelade and joined then together there would be a single step from Brighton to Sydney, this may be what you see in the straight parts of your examples
 
Thanks much.

The original GPX files I downloaded each contained a single track, and I needed to merge all the files into a single GPX since Google My Maps only takes one file per layer.

After experimenting, I found a solution:
  1. If need be, make sure the GPX filenames are sequential to match the route, eg. 01.gpx, 02.gpx, etc.*
  2. Run this to merge the files into a single GPX file:

    SET APP="c:\Program Files\GPSBabel\gpsbabel.exe"
    setlocal enabledelayedexpansion
    set f=

    for %%f in (*.gpx) do set f=!f! -f "%%f"

    %APP% -t -i gpx %f% -x nuketypes,waypoints -o gpx -F merge.nuked.gpx


  3. Upload into a new layer in Google My Maps
  4. If you wish, select and remove each and every start/stop endpoints.

Thank you.

* That's the problem I had: The files weren't named sequentially, and I assumed the application (GpsBabel, etc.) would figure out the whole route
 

Members online

No members online now.
Back
Top