Search around a particular Latitude and longitude by a given radius

This post is related to search around a particular latitude and longitude for a given radius in Km or Miles.
  • One degree of latitude is equal to about 69 or 70 miles or 111 Km.
  • Suppose you have to search in a circle of 4 miles ,the center of the the circle is lat,long you have.
  • Since 70 miles is equal to 1 degree lat then the latitude radius will be “4/70=0.057″ .
  • now suppose the center point lat, long is:latitude=26.262011,longitude=81.546562 then the range will be in which you have to search will be
  • minLat=26.262011- 0.057
  • maxLat=26.262011+ 0.057
  • minLong=81.546562 – 0.057
  • maxLong=81.546562 + 0.057
  • Now you can run a sql query to database with between statement like:- where latitude between “this” and “this” and longitude between “this” and “this” .
  • It will give you all the location’s lat ,long that are in that 4 miles circle around given lat long center point.
  • Some Resources for Understanding latitude and Longitude:
  • http://www.infoplease.com/homework/latlongfaq.html
  • http://www.infoplease.com/ipa/A0908193.html
  • http://www.hammondmap.com/catalog/classroom_activities/latlong1.html

Subscribe / Share

Article by Irfan Raza

Authors bio is coming up shortly.

One Comments

  1. Rob says:

    Just the info I was looking for, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>