Joining two GPX tracks

General cycling advice ( NOT technical ! )
francovendee
Posts: 988
Joined: 5 May 2009, 6:32am

Joining two GPX tracks

Postby francovendee » 14 May 2019, 4:26pm

Does anyone know of a way to join two gpx files so that when opening them in Osmand on the phone they appear as one track. The two tracks continue on from each other and I can load them separately but it'd be nice to have them as one long file.

User avatar
Mick F
Spambuster
Posts: 46811
Joined: 7 Jan 2007, 11:24am
Location: Tamar Valley, Cornwall

Re: Joining two GPX tracks

Postby Mick F » 14 May 2019, 4:31pm

I know how to do it on a Mac with Ascent.
I do it lots of times using "Combine Activities" function in the Edit list.
You can then export the combined route in any format and to anywhere you want.

Dunno how anyone else would do it, but Ascent would be my first port of call.

PM me with your email address and send the two to me. I can combine them and send the whole one back.
Mick F. Cornwall

Psamathe
Posts: 10603
Joined: 10 Jan 2014, 8:56pm

Re: Joining two GPX tracks

Postby Psamathe » 14 May 2019, 7:42pm

I generally use a text editor and out them in as 2 <trkseg>s. If one ends exactly (or close enough) to where the next starts you could just edit in the points.

Another way is GpsBabel (free, Google will find the site for you). It does lots of things merging GPX tracks is one of these.

Ian

Vitara
Posts: 189
Joined: 12 Feb 2014, 11:18pm

Re: Joining two GPX tracks

Postby Vitara » 14 May 2019, 7:53pm

It's very easy to do using Garmin Basecamp, although Basecamp is perhaps not the most user friendly programme to use.

Alternatively there are several sites where you can upload two (or more) GPX tracks and have them merged for you

e.g. https://gotoes.org/strava/Combine_GPX_TCX_FIT_Files.php

User avatar
Tinnishill
Posts: 145
Joined: 15 Sep 2013, 9:58am

Re: Joining two GPX tracks

Postby Tinnishill » 15 May 2019, 12:00pm

There was some chat about this on here

viewtopic.php?f=1&t=127537
Agitate, educate, organise.

User avatar
andrew_s
Posts: 4964
Joined: 7 Jan 2007, 9:29pm
Location: Gloucestershire

Re: Joining two GPX tracks

Postby andrew_s » 15 May 2019, 2:59pm

Psamathe wrote:I generally use a text editor


Me too.
Read the 2 files into the same editor window, and delete from </trk> at the end of the first file to <trk> at the start of the second (inclusive).

Alternatively, you could delete </trk> onwards from file 1, and start to <trk> at the start of file 2, then combine them by "type file1.gpx file2.gpx > combined.gpx" in a command prompt (cmd.exe).

That's fine provided that file2.gpx continues straight after file1.gpx (eg after an eTrex battery change, elevenses stop or similar), but not if (eg) file1 is A --> B, file 2 is C --> B, and a route A --> B --> C is desired.