3

I want find the shortest path/route between multiple locations available. i.e. suppose I have five locations A,B,C,D and E, I want to find the nearest location (using route distance not normal distance).

Currently I am making 5 URL and calling Google Direction API for result and comparing them. But it's long and time consuming process. Is there any alternative?

I also thought of using distanceTo() and distanceBetween() method but i think it doesn't show the route distance.

Any suggestions please....
Thanks

Michael Shrestha
  • 2,547
  • 19
  • 30
  • Check [this](http://stackoverflow.com/questions/15968245/proximity-search-based-on-latitude-and-longitude/16413354#16413354), Haversine is what you require. – Skynet Aug 26 '14 at 10:19
  • thanks for the reply ... i'll have a look.. – Michael Shrestha Aug 26 '14 at 10:24
  • Welcome, do check the .pdf document. Its all explained in there. – Skynet Aug 26 '14 at 10:28
  • It's a great document but it's similar to `distanceTo` and `distanceBetween` method. It returns the direct distance between two location but i am looking for the route distance between these two locations... – Michael Shrestha Aug 26 '14 at 10:42
  • Maybe KML is helpful in your case, I am not sure but you can check [here](http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations) – Skynet Aug 26 '14 at 12:48
  • I have already found the route of two locations using Google Directions API (json format) but i want to calculate route distance for multiple locations at once. that's the issue i am having. – Michael Shrestha Aug 27 '14 at 03:54
  • I am working on the same kind of project, I have to find shortest path between multiple locations.Please help me on this.Thanks in Advance. – Naveen Nov 28 '19 at 10:56

0 Answers0