1
votes

Hey i need to calculate the distance from my location to a lot of other locations (lets say 1000), the locations come in written addresses so i am getting their longitude and latitude using the geo coder, the issue is that for only 8 locations it takes lot of time to calculate, what is the fastest way to calculate this thing?

2
1/ you need the coordinates, there is no way around this. 2/ getting the address takes time, as it uses a resolution service somewhere not on your phone.njzk2

2 Answers

2
votes

The Google Maps Distance Matrix API may be what you're looking for.

You'd have to split up your many destinations in multiple requests, see the Usage Limits section.

0
votes

The other locations are always the same? If the answer is yes, why don't you store the locations in a database and also add the Lat and Long using the geocoder. After that, you can query by distance all the locations to your current location very fast.