想象一下有人在同一条街上跑了两次。但由于 GPS 并非 100% 准确,因此这两条路线是不同的。看看下面的图片你会更明白:
Red Line - First time run
Blue Line - Second time run
Black Line - Street
Dots - GPS coordinates (latitude and longitude)
我想要实现的是确认这两条路线是相同的。有人知道吗?
最佳答案
尝试使用 Fréchet 距离来应用 G. Bach 的建议。在维基百科上可以找到对其的详细描述(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.
关于objective-c - 如何检查两条GPS路线是否相等?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25656120/