Solutions for geotargeting the closest big city to a user?

Sonny Forelli

Well-known member
May 8, 2008
2,330
89
48
Liberty City
Any solution that people have found? For instance in CA I'd like to be able to target: San Francisco, Los Angeles, and San Diego only based on geographical proximity via ip lookup.

Other states similar.
 


That would be quite an easy script to write. You just need a list of all towns and a list of all big cities. Geocode all the towns and cities and the loop over all the towns to see which big city is closest by and store that info. For geocoding you can use Yahoo! Maps Web Services - Geocoding API or The Google Geocoding API - Google Maps API Web Services - Google Code

Problem with those are you can only do 2500 with google and 5000 with yahoo geocoding queries per day. So use some proxies. The geocoding only need to be done once.
 
That would be quite an easy script to write. You just need a list of all towns and a list of all big cities. Geocode all the towns and cities and the loop over all the towns to see which big city is closest by and store that info. For geocoding you can use Yahoo! Maps Web Services - Geocoding API or The Google Geocoding API - Google Maps API Web Services - Google Code

Problem with those are you can only do 2500 with google and 5000 with yahoo geocoding queries per day. So use some proxies. The geocoding only need to be done once.

he'll have to store that info in a db so it really comes down to his dev skills (not that this is that hard).