Random Projects and Comments

Home Arduino GPX Library Bug
formats

GPX Library Bug

Drive-022711
Ran into a bug in my GPX Library that produced some interesting results. The problem manifested itself as what initially looked like half my data from a test drive being currupted, I initially was thinking it was a memory problem, or data being currupted in the I2C transfer. After looking at the tracks for a while trying to figure out how they got currupted I noticed that the point where the data went from clean to corrupt appeared to be level. When I focused in on these points they were in fact exactly at 43deg latitude. I then noticed a small piece of what looked to be clean data a bit north of the 43deg point. Uppon inspection clean data was at 43.10000 deg latitude. It didn’t take long to realise that I had not padded the fraction part, so 43.00001 was going into the file as 43.1
Drive-022711-fix
I went back to the source file and quickly fixed them with ‘sed’ and the result is a much cleaner track.
Drive-022711-2
And when over layered with OSM (http://www.openstreetmap.org/) data the track appears to be very accurate!

 
credit
© Ryan M Sutton, 2015