Page 1 of 1
distance from one zip code to another zip code
Posted: Mon Feb 26, 2007 3:38 pm
by psychotomus
anyone know how to determine the distance between zip codes or if theres some functions floating around the net i can use freely to determine this (for usa residents)
Posted: Mon Feb 26, 2007 3:40 pm
by TheMoose
You'd need a listing of all the zipcodes and their relative latitude and longitudes in order to do a distance calculation. Yes, there are things that exist for the US, but I believe for most of them you have to pay.
Posted: Mon Feb 26, 2007 3:46 pm
by psychotomus
Wouldn't happen to know of any links?
Posted: Mon Feb 26, 2007 3:48 pm
by TheMoose
Posted: Mon Feb 26, 2007 3:52 pm
by psychotomus
thanks you sir.
Posted: Mon Feb 26, 2007 4:03 pm
by feyd
There have been several threads here dealing with the "great circle" math to calculate the distance, what's in the radius and so forth.
Posted: Mon Feb 26, 2007 4:06 pm
by psychotomus
feyd wrote:There have been several threads here dealing with the "great circle" math to calculate the distance, what's in the radius and so forth.
and people don't think algebra and higher math is involved in programming =)
Posted: Mon Feb 26, 2007 4:09 pm
by veridicus
The German company I've worked with gave us geodata in both latitude/longitude and x/y format. They run an algorithm that basically flattens the earth so very simple algebra can be run during searches for fast distance calculations.
Posted: Tue Feb 27, 2007 2:36 am
by CoderGoblin
Check out
Geonames for other countries. You do need the great circle algorithm. I know I use postgres but the method I use to access information quickly is to calculate the distance from a known location (In Germany, Aachen where I work) and store that information in the database as X,Y points (North,East as km). I can then simply use the database geometry functions/Trig rather than relying on calculating Great Circle each time. It needs a bit of pre-processing to get the North/East distances but is fast.
Posted: Sun Sep 30, 2007 2:27 pm
by MicahCarrick