Reputation: 1082
Imagine some guy ran the same street twice. But as GPS is not 100% accurate, those two routes are different. You can understand better looking at the picture below:
Red Line - First time run
Blue Line - Second time run
Black Line - Street
Dots - GPS coordinates (latitude and longitude)
What i'm trying to achieve is to confirm that those two routes are the same. Does anyone have any idea?
Upvotes: 2
Views: 451
Reputation: 149
Try using the Fréchet distance to apply G. Bach's suggestion. A good description of it is found on Wikipedia (http://en.wikipedia.org/wiki/Frechet_distance):
The Fréchet distance between two curves is the minimum length of a leash required to connect a dog and its owner, constrained on two separate paths, as they walk without backtracking along their respective curves from one endpoint to the other. The definition is symmetric with respect to the two curves. Imagine a dog walking along one curve and the dog's owner walking along the other curve, connected by a leash. Both walk continuously along their respective curve from the prescribed start point to the prescribed end point of the curve. Both may vary their speed, and even stop, at arbitrary positions and for arbitrarily long. However, neither can backtrack. The Fréchet distance between the two curves is the length of the shortest leash (not the shortest leash that is sufficient for all walks, but the shortest leash of all the leashes) that is sufficient for traversing both curves in this manner.
Upvotes: 2