I want to calculate the closest distance from a location (lat/lon) to a given route. The route consists of approximately 20.000 location points.

I could calculate the distance to every location point and check the results for shortest distance, but that seems quite CPU-intensive as I receive a new location every second.

Does anybody know an algorithm that is covering my problem?

  • 2
    Welcome to GIS.SE. Some information on your preferred software and language could be helpful. Also some details/clarifications would help, it seems like you want to calculate in real time, for every new location point? – Erik Jan 15 '19 at 10:50
  • I am developing an android application, which is tracking the phones location and displays an status whether the user is "traveling" on or off a pre-defined route. For every new location point I have to calculate the shortest distance to the route in real time. Cheers. – manu_SE Jan 16 '19 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.