2

I am building an application that holds a lot of addresses in a server. I want to get a list of addresses in a certain radius of the user and then compare them to the addresses held in the server. The problem is I don't know how to set up a radius around the user, and I don't know how to get all the addresses in that radius. I can get the user's address/location, and I know how to compare the addresses to the addresses in the server. Does anyone know how I might set up a radius around the user and get all the addresses in that radius? It doesn't have to be an answer in code, any ideas would be helpful, but a good explanation and some code would be useful. Thank you!

  • You have two choices, do it on the client-side or do it on the server-side. I think it makes more sense to do it server-side, as if you do it client-side you would need to download all addresses every time, and then filter them. Take a look at this: http://stackoverflow.com/questions/14254641/mysql-query-select-nearest-places-by-a-given-coordinates – Daniel Nugent Nov 11 '15 at 21:12

1 Answers1

0

Use Google Maps Distance Matrix API to get the distance to each of the address and filter them by their distance to match the specified radius.

Bogdan Kobylynskyi
  • 1,150
  • 1
  • 12
  • 34