Author Topic: Stitching my tracklogs back together  (Read 1621 times)

caerau

  • SR x 3 - PBP fail but 1090 km - hey - not too bad
Stitching my tracklogs back together
« on: 17 June, 2013, 04:46:08 pm »
Hi, I rode the national 400 this weekend and because of the notoriety of the Edge800 for crashing whilst trying to record such a long ride I recorded it as two separate rides.
Now I would like to stitch them back together but I can't work out how  :-\

I've dowloaded both from Strava and tried editing them together in textedit (I'm using a Mac) but despite it looking reasonably obvious what to do, it clearly isn't as it won't work.  I've just been removing the XML tags at the top and bottom of the document from the second half and leaving in all the <trkpt>...</trkpt> and then pasting it into what should be the right place in the gpx text document of the first half.

I've also tried advice I saw somewhere here a few weeks ago that involves joining routes on basecamp.  That works but all it gives me is a route not an activity.

Any suggestions?  Ta muchly
It's a reverse Elvis thing.

Jaded

  • The Codfather
  • Formerly known as Jaded
Re: Stitching my tracklogs back together
« Reply #1 on: 17 June, 2013, 04:53:07 pm »
You should be abe to do it in text edit. If you are stuck I could join them in an app I use?
It is simpler than it looks.

caerau

  • SR x 3 - PBP fail but 1090 km - hey - not too bad
Re: Stitching my tracklogs back together
« Reply #2 on: 17 June, 2013, 05:12:11 pm »
Aha, I have actually managed it in textedit - at least to satisfy garminconnect anyway.

looking at the headers in the files I was trying to stitch together two files one exported from Strava and the other from Garminconnect.  This may have been the issue.  Exporting them from the same source and then doing seems to have worked.

Thanks for the offer anyway and thanks also for such a marvellous show at Kingswood on Saturday evening.  Yours was the last point on the ride where I felt good, human and in good spirits!
It's a reverse Elvis thing.

Feanor

  • It's mostly downhill from here.
Re: Stitching my tracklogs back together
« Reply #3 on: 17 June, 2013, 05:17:53 pm »
The native files from the Edge are .fit files, which are binary files not text files.
These can be spliced using the Fit File Repair Tool into a single fit file, containing 2 laps.

If you upload them to eg Garmin Connect as 2 separate rides, then export each as a GPX, you will get 2 GPX format text files which you can then manually splice in the text editor.

So long as the GPX file contains <trkpt> nor <rtept> then you're good to go.
Sounds like what you are already doing is basically correct, but if it's not working, perhaps you're missing a tag someplace  ( or perhaps an un-matched parenthesis ?

You can join tracks in basecamp, and that will give you a track.
Not sure how you've got it to be a route.

Why don't you post the strava links to the 2 segments, so I can download them and splice them, and then I'll send you the result, and you can compare it to your own attempt?

Either that, or send me the original fit files and I'll splice those.

caerau

  • SR x 3 - PBP fail but 1090 km - hey - not too bad
Re: Stitching my tracklogs back together
« Reply #4 on: 17 June, 2013, 05:25:35 pm »
OK, that sounds good.  You're clearly mistaking me for someone who knows what they're talking about I'm sure you are correct about what I did in Basecamp - not sure of the difference between a route and a track  :-\

What I've done uploads to Garmin connect OK but it won't upload to mapmyride or Strava or anything else I use.  You will have mail soon.

Thanks once again.

It's a reverse Elvis thing.

Feanor

  • It's mostly downhill from here.
Re: Stitching my tracklogs back together
« Reply #5 on: 17 June, 2013, 09:26:46 pm »
For the record, the issue turned out to be that the merged file had too many data points and hit a trackpoint limit on the websites.

After merging the original fit files, it would upload to Garmin Connect, but not the others.
I then down-sampled the file by dropping every second trackpoint.
This uploaded OK.

I've also come across trackpoint limits on Garmin Connect too in the recent past, with someone's 600k ride, so it's a common issue.

Basically, these websites don't expect people to ride 400 - 600k.

You're all just riding too far!


caerau

  • SR x 3 - PBP fail but 1090 km - hey - not too bad
Re: Stitching my tracklogs back together
« Reply #6 on: 17 June, 2013, 10:07:30 pm »
Well as my brother just told me on facebook.  Bunch of nutters.  ;D
It's a reverse Elvis thing.

bikey-mikey

  • AUK 6372
  • Yes, I am completely mad ! a.k.a. 333
Re: Stitching my tracklogs back together
« Reply #7 on: 20 June, 2013, 09:40:16 am »
It was my 600 that you helped with, (for which my thanks again), but things have moved on since I now find the 810 will only record data on an 'every second' basis even though I have set it to 'smart record'.

My 200 km ride yesterday was over 10,000,000 KB so way bigger than usual.

Garmin issued a firmware update which I have just installed and I'll walk round the block soon and see if they have craftily corrected the problem, else it is a fault with my unit...

I'll also post separately asking 810 owners if they have smart record problems...
I’ve decided I’m not old. I’m 25 .....plus shipping and handling.

Cycling heatmap
https://www.strava.com/athletes/4628735/heatmaps/6ed5ab12#10/51.12782/-3.16388

Re: Stitching my tracklogs back together
« Reply #8 on: 20 June, 2013, 11:40:00 am »
Is the size of the file definitely related to the problem or is that a guess?

Not an 810 but the few times I've had corruption on my Edge 705 (it freezing for no reason) have been unrelated to ride length. I've got 10 or so rides above 10MB (a 200km Audax is 10MB for me as I have cadence and power sensors and I purposely set it to 'every second') going as high as 42MB (part of K&SW 600) and 45MB (part of PBP 2011).
"Yes please" said Squirrel "biscuits are our favourite things."

Feanor

  • It's mostly downhill from here.
Re: Stitching my tracklogs back together
« Reply #9 on: 20 June, 2013, 10:53:31 pm »
Let's not confuse different issues.

File corruption can occur at any point unrelated to anything: not distance, or time.
This is the GPS firmware having a brain-fart for reasons unknown.
This will result in corrupted files because they are suddenly truncated, and not correctly closed out.
Data may be recovered from these files up to the point where the brain-fart occoured.

There are some errors that occur at well-known points on certain devices ( eg the edge800 400k bug ).
Again, the file may be suddenly truncated and incorrectly closed-out.

There are problems where no error occurred on the GPS unit, but the resultant valid file will not upload to the various websites because of un-published limitations.   This is discovered by trial-and-error.

What we do is look at the data we have, and reverse-engineer the various undocumented state-machines the best we can.