Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to sort a list of Lat/Lon coordinates by distance?

I am planning routes so that one person can make the journey between various points by taking the shortest possible time.

Thanks, and hope you can help me.

2 Replies
Not applicable
Author

Ah a classic! The travelling salesperson problem. I wouldn't recommend QV as the best environment to solve it, but it can be useful as a tool to play around with the route.

As for distance between longtitude and latitude, most accurate is if you look up actual traveling distances/times, as this can deviate a lot from 'fly-distance'. But if you want to estimate distance when actual distance is not known, you can take a look at the Haversine formula.'You typically create a matrix containing all distances between all points.

Visiting the nearest neighbour on every visit is easy to implement, but is known to sometimes give efficient and sometimes very inefficient routes.

gl Jeroen

Not applicable
Author

thanks for your reply, i see it is as hard as i imagined