2

Possible Duplicate:
SQL: Determine if one coordinate is in radius of another

I've got a question about geolocation in PHP.

I've got latitude and longitude values. Do you know how can I have new values from distance?

I mean, I want to have all the stores 1 or 2 miles around, for example, from a position. My database contains shops with latitude and longitude values, and I want to have all near stores.

Do you understand what I mean?

Community
  • 1
  • 1
Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57
  • Are you storing the places in a database or are you using an API for them? How many places will there in be (more or less)? – Brett Gregson Oct 25 '12 at 14:04
  • If you have everything locally, you can just do the math yourself: http://gis.stackexchange.com/q/3945/5085 – psubsee2003 Oct 25 '12 at 14:17
  • deceze : Oh yes, it's a good code ! But... how can i get it in meters ? thanks a lot. eskimo : i'm storing the place in the database yes, maybe 10 000 places in the database – Florian Mac Langlade Oct 25 '12 at 14:27

1 Answers1

1

You can probably use a Google Maps API - eg. Google Maps Geocoding API for this. Look into their documentation, its rich with good info.

Jeff
  • 12,085
  • 12
  • 82
  • 152