I'm a logistics programmer, and I've been asked to figure out if a GPS point is "off route" where the route consists of a number of geospatial points (latitude,longitude).
What is the best algorithm for determining if a point is near the route? I will be using C# and SQL Server, but really that doesn't matter a whole lot if I know what algorithm to use.
I've considered
- Finding the two nearest points and determining if the area of the triangle is above a specific limit.
- Using vectors for all pairs of points and then checking to see if any of them are "similar" to the vector defined by the GPS point and the point I determine to be "next" in the route.
I don't have a mathematics degree, but I can probably handle about anything given the correct terms and a search engine.
I will have to make at least 4000 calculations an hour so using a mapping solution is probably not acceptable due to volume.