How can I merge two GPX files into one?

Read the above link but my gpx files do not seem to have this in them:

Copy all the stuff between Open the second GPX file in a text editor. Copy all the stuff between <trk> and </trk> inclusive

I exported my ViewRanger file and saved the gpx file then opened in Windows Notepad. There is no <trk> and </trk> anywhere.

The first line of the file, opened in Notepad is:-

<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/0" version="1.0" creator="ViewRanger - http://www.viewranger.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

See this dropbox link for one of the files:-


I need to merge 18 files (Lands End to John O Groats)

What am I doing wrong?

  • So if you search for "trk" in the file, nothing is there?
    – Batman
    Oct 18, 2014 at 17:54
  • could be its not a track I suppose. Any chance you could put the files somewhere, and one of us can eyeball them?
    – PeteH
    Oct 18, 2014 at 20:07
  • Look further down in the file. This is the xml header describing what the nature of the document.
    – Rider_X
    Oct 18, 2014 at 20:13
  • What platform did you use to do the export? While I support the Rider_X comment and @Batman's question, it could also be that the EOL characters are wrong. Most Windows software expect CR/LF. This link says the export format is platform dependent.
    – andy256
    Oct 19, 2014 at 3:57
  • Yes, spot on @PeteH. It turned out to be a route, that other people can follow.
    – andy256
    Oct 19, 2014 at 20:30

4 Answers 4


Ok, Looking at the data you posted, you can see




These tags enclose the whole GPX Route.

After the tag comes the name. You can put what you like in between the second [ and the ]]:

<name><![CDATA[End to End - Day 1 -  Lands Ends to St Just]]></name>

Then comes an ordered set of routepoints

<rtept lat="50.066113" lon="-5.712081">

You can construct a file starting with the first three lines

<?xml version="1.0" encoding="UTF-8"?>

<gpx xmlns="http://www.topografix.com/GPX/1/0" ...


Then add in all the routepoints from your various GPX files.

End with



Hope that helps.

  • I will need to experiment; should be interesting as some routes have vast numbers of waypoints. Oct 20, 2014 at 9:33

Looking at the dropbox file it appears to contain a route, rather than a track. I suspect something went wrong when you exported the file. If there are options on what to export, then you want to export the track rather than the route or waypoints or anything else.

This Wikipedia article on GPX has more details on GPX files which might help..

  • When I use the button "Export to GPX" I am only given the option to save file; can't select track or route. Oct 20, 2014 at 9:33

I don't think I will be able to do what I really want.

My idea is to have an A3 print, or even an A2 print, of our whole route from Lands End to John O Groats, overlaid over a map of the UK.

I now have a gpx of the whole route

However the only place I can get a reasonable representation is on my tablet or phone.

This has to do with esthetics not information.

These two images, one a screenshot from my tablet and the other a screenshot from Google Earth show the esthetic differences:-



The tablet screenshot would look ok, in a larger size (if I could scale the map detail as well i.e enlarging this just shows towns etc as blurs); the blue overlay gives enough detail without being over bearing. The line Google Earth shot is just too thick.

  • What do you want the big printout for? a poster or something?
    – Ifor
    Oct 24, 2014 at 15:45

Each member of our "End-to_end" ride would like an image to hang on their study wall; bearing in mind our, now, ages, some are not that au-fait with computers and prefer the technology in use when we did the ride i.e. 1998, even if I had to use the latest to produce the image. A2 ideally but A3 would do.

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.