Yet Another Cycling Forum

General Category => The Knowledge => GPS => Topic started by: Hot Flatus on 02 October, 2011, 02:40:39 pm

Title: Fusing two .tcx files.
Post by: Hot Flatus on 02 October, 2011, 02:40:39 pm
I have two tcx files that I want to merge for the purposes of DIY by GPS validation. The GPS nunit decided to switch itself off at one point, hence the two files.  How the bloody hell do I do it? I tried cutting and pasting the second file onto the end of the first in Notepad, but it wouldn't have it.

Confused of Gloucestershire.
Title: Re: Fusing two .tcx files.
Post by: RichForrest on 02 October, 2011, 02:47:47 pm
Just send both, sometimes I get 2 or 3 in a zip file and they open in the software together. Other times I just open them separately to validate them.
They will be fine as it's only proof that you have passed through the controls in a specified time that counts.
The route between them doesn't matter as the shortest distance has been ok'd beforehand.

Rich
Title: Re: Fusing two .tcx files.
Post by: Hot Flatus on 02 October, 2011, 02:50:44 pm
Ah thanks Rich. I did send them, in a fit of pique, after trying for half an hour to merge them.  It has taken a week for me to have guilt pangs.  ;D
Title: Re: Fusing two .tcx files.
Post by: smurphboy on 02 October, 2011, 03:19:41 pm
I've not tried this but I did read this thread on the Garmin forum. Seems to suggest they can be merged either via XSLT or a java prog. Usual rules about downloading s/w from forums but might be worth a shot?

A solution for combining/merging two TCX files (activies) (https://forums.garmin.com/showthread.php?t=13784)
Title: Re: Fusing two .tcx files.
Post by: Hot Flatus on 02 October, 2011, 03:24:05 pm
Thanks, but to be honest that starts to stray into territory into which my ICBA side pops out  ;D
Title: Re: Fusing two .tcx files.
Post by: fuaran on 02 October, 2011, 04:18:49 pm
You could import them both into Garmin Basecamp, then join the tracks (Edit menu -> Advanced -> Join selected tracks), then export as a TCX file.
Title: Re: Fusing two .tcx files.
Post by: Hot Flatus on 02 October, 2011, 04:48:54 pm
Ah. First I'll have to find out what Garmin Basecamp is. Thanks, I'll give it a whirl.
Title: Re: Fusing two .tcx files.
Post by: Jaded on 02 October, 2011, 05:11:03 pm
An XML file is just a set of nested tags. All you need to do is strip the appropriate tail tags off the first file and the top tabs off the second file. After two beers that should be easy.
Title: Re: Fusing two .tcx files.
Post by: sbseven on 03 October, 2011, 06:23:55 pm
Further to Jaded's post.

Using notepad (or even better, use foxe (http://www.firstobject.com/dn_editor.htm)):
Title: Re: Fusing two .tcx files.
Post by: thesloth on 21 May, 2012, 11:36:46 pm
This entry is a duplicate of what I posted at http://yacf.co.uk/forum/index.php?topic=58702.msg1236152#msg1236152
Thought it might also be appropriate to relist it here:

I've encountered the "Edge 800 crash after 400km" three times. After the first two times I returned the unit to Garmin and they replaced it.
The new unit had the same issue. After a bit a research I found that a number of other people had experienced the same issue.
There are a few entries on the Garmin forums eg:
https://forums.garmin.com/showthread.php?t=17002

Until Garmin confirm a definite fix for the issue a way round this problem is to reset your activity at a "safe" distance of say 300km and then merge the multiple activities into one.
I tried a few different ways of doing this:

Garmin Basecamp (http://www.garmin.com/uk/maps/trip-planning-software/basecamp) - Can join activities, but only a basic track. You loose other info like heart rate and cadence.

TCX Converter  (http://www.teambikeolympo.it/TCXConverter/TeamBikeOlympo_-_TCX_Converter/TCX_Converter_ENG.html) - Can join two activities, but seems to consistently corrupt very long rides, placing random points several thousand km away. It also can't deal with activities spaning two or more days.

CombineActivities.jar (https://forums.garmin.com/showthread.php?t=13784) - This works in so much that it successfully joins the two activities. The problem is that you need to copy and paste the result from the program into a text file. Most computer operating systems can't cope with this, due to the size. I found that Windows 7 and Mac OSX couldn't deal with 2x200km, Ubuntu Linux could. Even Linux couldn't cope with 2x300km

Ascent  (http://www.montebellosoftware.com/) - I've successfully used the free trial version of this software to join two 300km .fit files. Unfortunately this software is only available for Max OSX.

Training Peaks (http://home.trainingpeaks.com/) - I read somewhere that you could do this on the desktop version of this product. They now seem to have a web based version. I've not tried it.

If anybody knows any other methods other than Ascent  (http://www.montebellosoftware.com/) please share.
Title: Re: Fusing two .tcx files.
Post by: David Martin on 21 May, 2012, 11:53:03 pm
I'd do it by hand in a text editor. But then I am a bit old-school hackerish.

It should be a very short python script along the lines of

import xml.dom.minidom
doc1=xml.dom.minidom.Document(filename1)
doc2=xml.dom.minidom.Document(filename2)
creator=doc1.getElements("Creator")
for e in doc2.getElements("Lap"):
  creator.insertBefore(e)
print doc1.asxml()

This won't work as I haven't looked up the proper methods but should be pretty close to what you can do.

..d
Title: Re: Fusing two .tcx files.
Post by: fuaran on 22 May, 2012, 12:05:51 am
Garmin Basecamp (http://www.garmin.com/uk/maps/trip-planning-software/basecamp) - Can join activities, but only a basic track. You loose other info like heart rate and cadence.
Have you tried the latest version of Basecamp (currently v 3.3.3)? Older versions stripped the heart rate data, but that has since been fixed. It works fine for me anyway - joining/splitting activities from my Forerunner or Foretrex, then exporting as GPX or TCX. The exported files have all of the heart rate data (I've not got a cadence sensor).

Or Garmin Training Center should also be able to do this.
Or you could try SportTracks.
Title: Re: Fusing two .tcx files.
Post by: frankly frankie on 22 May, 2012, 08:54:57 am
I'd do it by hand in a text editor. But then I am a bit old-school hackerish.

Surely the easiest and IMO the safest way.  If you combine stuff in software, you don't know what else it might be doing to the data.