0

I need to implement geocoder in my project and I would need to be as efficient as possible. So I have to get all the persons in the system who are in a certain range from a given point. Is there any way to do this without polling everyone in the system to get the position at the given time and then filtering the results? It's somehow like a radar or something, but I have no idea how to do it.

Thanks in advance

Mihai Bujanca
  • 3,919
  • 9
  • 40
  • 81
  • Please elaborate. The question is rather vague and the answers, if any, will probably be opinion based. – Alex Filipovici Oct 29 '13 at 14:50
  • I would want to get all the persons registered to my system who are at a certain moment in a given area. – Mihai Bujanca Oct 29 '13 at 14:55
  • Is the given area a circle with a given radius around a certain point? – Alex Filipovici Oct 29 '13 at 14:56
  • Yes, the point and the radius are given by a client, i need to return all the other persons in the system that are in that area. However, what I DO NOT want is to verify all persons in the system and than display only the ones in the area. I want to check only the area – Mihai Bujanca Oct 29 '13 at 14:58
  • Take a look at the accepted answer of [Calculate distance between two points in google maps V3](http://stackoverflow.com/q/1502590/674700). It's actually not using the Google Maps API, it's an implementation of the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula). At some point, you still have to evaluate (at least a part of) the position of every person in your system. – Alex Filipovici Oct 29 '13 at 15:02
  • What database are you using? – Alex Filipovici Oct 29 '13 at 15:06
  • Maybe I was not explicit enough, I am sorry. Let's think about a radar: it gets the position of certain elements within a range. The important thing is that it only searches within that range. Now that is what I want to do. Search if there is any person in the defined area. Just as a radar tells if there is any ship in an defined area – Mihai Bujanca Oct 29 '13 at 15:08
  • For now, a MySQL database. But not sure if this will change or not, we only began to work on the project a week ago – Mihai Bujanca Oct 29 '13 at 15:08
  • Use a database that supports better spatial queries, like PostGIS. – scai Oct 29 '13 at 20:22

0 Answers0