Suppose I have an ordered array containing points (lat, lon)
describing a path, and I also have a point (lat, lon)
describing my current location.
How can I project the point onto the path (and place the point in the appropriate place in the array)?
What I tried is just simply by searching for the nearest two points and assume it's in the middle of them. It's a good guess, but sometimes fails.
What would be a good way of doing this?