# How can I statistically calculate the “real” road from a set of GPS tracks

I participate in a long-distance cycling club, and we started to collect GPS data routinely from our riders.

My interest is to calculate "the real trajectory" for future events based on accumulated GPS data over the same roads. Basically, this would mean to pass some pre-selected tracks to an algorithm, and the algorithm would generate points at an appropriate sample rate (an appropriate distance from one another depending on road curves). I will discard timestamps, taking only spatial track information into account.

Which algorithm/statistic methods could I use? I don't use any GIS package and I plan to implement this in Python.

Below, some sample trajectory sets:

-
Interesting project - quite similar to an inspection algorithm I wrote years ago. Since I'm lazy, I can only offer a few hints. Most important factors are direction of travel, signal quality and your velocity (ie. if you're just standing around, it's not a road). Best to first cull the points that are too far off that way. Other than that, I'd apply a smoothing algorithm (try DP) then average the lines. – nagytech Sep 4 '13 at 23:11
DP = Dynamic Programming right? Wikipedia gave me a long homework reading on this for tonight... Thanks for now! – heltonbiker Sep 4 '13 at 23:53
An interesting, related question is this: gis.stackexchange.com/questions/42224/… – heltonbiker Sep 4 '13 at 23:55
Something really, REALLY worth checking is your GPS settings - some GPS units "snap" your position to the closest road in the GPS database, even if the real road is 10+m to the side. – Simbamangu Sep 6 '13 at 5:08
@Simbamangu that would be a very nice thing to have indeed. I believe the software I am using today in an android phone doesn't have that. But anyway, most of my tracks were collected by other people in the past months. Thanks for the tip! – heltonbiker Sep 6 '13 at 12:31