Take the 2-minute tour ×
Bicycles Stack Exchange is a question and answer site for people who build and repair bicycles, people who train cycling, or commute on bicycles. It's 100% free, no registration required.

On a recent ride, my GPS stopped functioning about half way through. From other sources I have approximate times for the missing data and I know the route, so (in principle, though I'm really not sure how) I could manually create a track for the second half of the ride. But how do I combine this data with the GPS data from the first half of my ride?

Is there a way to take two separate GPX tracks and combine them into a single one? What issues arise in "syncing" overall times, speeds, etc.? Are there tools that assist in reconciling them?

share|improve this question
4  
I think they're basically XML files (if they're like TCX), so, with a bit of careful cut-and-paste you may be able to remove the headers and footers, then insert the extra bit before the footer of the original. See also gis.stackexchange.com –  James Bradbury Aug 19 '13 at 14:29
    
THe hard part is getting the gpx for the missing part of the route. You can create a route in google maps and export it to KML (google's format). Then use GPSBABEL to convert KML to GPX. You can then manually merge the two gpx files in an editor. –  Angelo Aug 19 '13 at 14:35
    
@JamesBradbury: That's a good idea. Simple cut and paste in a text editor might do the trick. As Angelo says though, I'm finding the hard part (despite suggestions here) to be creating the missing route. –  2u2 Aug 19 '13 at 14:49
    
@Angelo: Is there a way to make the process of creating a route for tie missing data less painful. What I have for that is (1) times at a few milestones and (2) the route. But it's not clear how to use that to create a "ride" without a lot of calculation and tedious work. There must be some way to take that information (even just a start, and end and a route) and create an "averaged" ride, but I can't find it. –  2u2 Aug 19 '13 at 14:51
    
@2u2, Looking at an example GPX file, I see that waypoint elements, "WPT", have child elements with latitude,longitude and elevation, and time (among other things). The time format is just ISO8601, "YYYY-MM-DDTHH:MM:SSZ". This is UTC time. So if you have some waypoints and their times, you can just add them if you convert local time to UTC time. –  Angelo Aug 19 '13 at 14:57

2 Answers 2

up vote 6 down vote accepted

GPX files are XML files, which means you can edit them in a text editor. I use Notepad++ on Windows and TextWrangler on OSX, but you should be able to use the built-in Notepad or TextEdit. Don't use a word processor like Word or OpenOffice.

  1. Open the second GPX file in a text editor. Copy all the stuff between <trk> and </trk> inclusive.
  2. Open the first GPX file in a text editor. Paste the copied stuff after the </trk> line near the end of the first file and save.
  3. If you have more files, repeat.
share|improve this answer
    
Yeah, if you use Notepad++, you can get a lot of help from the XML Tools Plugin. Many GPS units won't save the files nicely formatted with line breaks and indented lines, but a couple clicks using the XML Tools plug in can fix this up really easily. –  Kibbee Oct 7 '13 at 13:10

Try gpsbabel (either as commandline tool or via gpsvisualizer).
You can find an explanation how to combine files at http://www.gpsbabel.org/htmldoc-development/Advanced_Usage.html

share|improve this answer
    
GPSBabel is a bit of overkill for simple merges. In fact, it has large but odd collection of capabilities. So far, it looks like simple text editing does the trick. GPX files are (it turns out; I didn't realize when I started) pretty simple XML files. Combining them is straightforward with a text editor. –  2u2 Aug 21 '13 at 18:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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