[thelist] closest location tool
David Siedband
david at calteg.org
Thu Jun 3 19:15:44 CDT 2004
Consider a GIS based solution. It shouldn't be hard to find point data
for the center of zip codes, as build a table with your locations and
their GPS datum.
Check out the PostGIS extension for PostrgeSQL
http://postgis.refractions.net/
You can use it to calculate distances between the zip codes and the
locations.
I would create a index table with one entry for each zip code and the
LocationID of the closest location. Iterate through the zip codes and
find the closest location for each one. Then cache the results.
Repeat this process when you add new locations. You could make this
process more efficient by breaking the zip codes and locations into sub
groups so you're not comparing every zip code against every location.
You could do this on a development machine and put the index table
online using the database of your choice: MySQL, etc.
--
David Siedband
Oceanic Sky New Media
http://oceanicsky.com
On Jun 3, 2004, at 10:10 AM, Joel D Canfield wrote:
> Is calculating airline miles based on zip code still the best 'find our
> closest location' concept for the US?
More information about the thelist
mailing list