[geeks] City & Province -> Lat/Long?

Dave Kimmel crisco_kid at shaw.ca
Thu Jun 6 12:02:16 CDT 2002


I've been given an interesting (read: tedious) task at work which involves
finding all of the records where the address is within a given
geographical area.

So far I've reduced this to a simple, but tedious, excercise by getting a
list of cities out of the database, using Excel to generate a URL to
MapQuest that'll show me the city on the map at a decent zoom level.
Then I can click on each link and delete the city if it isn't in the area
or leave it if it is.  I plan on taking the list of cities and making an
SQL statement out of them for the final list.

I got to thinking that there must be a better way though.  So my idea of a
better way is to get the lat/long coordinates of the rough centre of each
city and build a table in the database out of them.  Then I can work some
magic and have it show me all the records where the lat/long are in
whatever range I need.

So, does anyone know of anything that I can feed a city, province, and
country to and get a lat/long pair back?

Thanks!
-- Dave Kimmel
   crisco_kid at shaw.ca



More information about the geeks mailing list