Lost my tracks

Yesterday I discovered something very disturbing. The XML file with the GPS track was missing 40 tracks in the log for the fourth. Not at the beginning or end but just, somewhere…?! This file has thousands of nodes and is almost 1 Mb big. A node looks likes this:
<trkpt lat=”52.387110000″ lon=”4.909017000″>
<ele>48,5</ele>
<time>2009-01-05T07:46:35Z</time>
</trkpt>
That’s very easy for a computer to read but not for a human.

screen dump of compare_times output
screen dump of compare_times output

I had to come up with a way to pinpoint the gaps. So I started to write a program called compare_times. I wanted a way to compare the times logged by the Suunto watch to the times stored by the GPS logger. Usually I don’t need the time node of a GPS track but now I could use it to see if the times weren’t matching at places. I output the times side by side to a file so I could compare them. And yes indeed, at some point they were not matching anymore.

Times in the GPS log that need my attention
Times in the GPS log that need my attention

So now I had to enhance my program so that it would point out to me exactly where things were going wrong. It’s impossible for a human to see for example two tracks missing at say 17:48:13 and 17:48:23 on a whole day. I decided that I would count the tracks in every minute. If there weren’t six tracks (logs) in one minute something was wrong. It sounds easy but it wasn’t all that easy to program. But I worked it out and ended up with a clean list of attention points so I knew where to look.
Mending the data was more work then writing the program. This was especially true for the log of the fifth. There 200 tracks were missing! Sometimes six minutes of data were just not there. Now I’ve got the day data of day 1 to 4. I hope the other days won’t be as bad.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.