This all started on a hiking trip to Žbevnica more than 10 years ago. I had my new GPS with me and a friend of mine had a GPS connected to a Windows ME phone. The hike was great, but when we returned to our cars, we were surprised to see that one GPS claimed we had walked 6.2km, while the other reported 6.7km. One claimed our elevation gain (i.e., the sum of all uphill parts of our hike) had been 300m, while the other reported it as 500m.
Being a programmer, I was immediately intrigued by the problem. I said to myself, “this should not be that hard to fix with a simple script.” After all, GPS tracks are just a list of tuples in the form of (latitude, longitude, elevation), right?
Well, not really.
And thus began my excursion into the fascinating world of GPS tracks and, more generally, geospatial programming.
Geospatial Information Systems (GIS) is a huge and complex domain, encompassing map projections andgeodetic datums, raster and vector data processing, and remote sensing. A comprehensive introduction to this domain would be well beyond the scope of this article. And since focusing on a specific problem can often be a useful way to introduce oneself to a new domain anyway, I’ll present a few specific challenges I encountered and some possible solutions; namely:
- How to recognize, understand, and programmatically correct GPS tracking errors
- How to compute and derive additional useful information from GPS tracks
For starters, GPS tracks are not just a series of (latitude, longitude, elevation) tuples. Many GPS-enabled devices will also provide metadata like time, heart rate, and so on. Some GPS devices will even provide information on how accurate the data is; a.k.a., “dilution of precision”. But, unfortunately, most GPS devices – especially the lower-end ones that dominate the market – won’t provide this information and we are left with the challenge of deducing the accuracy of the device on our own (and ideally correcting accordingly, where possible).
Let’s start with one possible algorithm to detect low-end GPS devices (like most smartphones) which usually have low-quality GPS data. Read more… @total