View Single Post
Old 12-07-2008, 09:30 AM  
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
Quote:
Originally Posted by rowan View Post
Never seen geo dating ads do surrounding areas, which seems like something obvious... guess someone has to think of it first! :D How do you determine the surrounding cities, is that part of the maxmind db too?

(I don't recognise any of the names in your sample because my geo IP loc pretty much always shows me in another state)
Surrounding areas are calculated from latitude/longitude parameters of the visitor IP - complicated maths cos the world isn't flat ;)
$theta = $lon1 - $lon2;
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$miles = $dist * 60 * 1.1515;
$unit = strtoupper($unit);

Surrounding areas can be turned off in that add image:

Nearby ON: and with Nearby OFF:
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202

Last edited by borked; 12-07-2008 at 09:32 AM..
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote