05-01-2009, 05:18 PM
|
#2 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
I've never done this, so this is just me theorizing. Zip codes do not indicate a location by themselves. You have to have a database that have the zips and their corresponding GPS locations (many are for sale, a free one is available at http://www.census.gov/tiger/tms/gazetteer/zips.txt ). Then using basic algebra, you use the following formula
r^2 <= (x-h)^2 + (y-k)^2
r being your radius, x and y being your testing points and h and k being your zip codes location. If a real number is returned x and y are within your circular radius.
There are probably algorithms to ensure you are only checking ones in the right geographic area.
|
|
|
|