Is there a way to calculate distance between 2 zipcodes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use some service to dynamically calcualte distance between two
zipcodes. Do you know about anything like this?
 
You could check the USPS website for a zip code index to give you the
locations and then maybe Rand-McNally to get the mileage estimates between
the cities that the zip codes apply to. As far as a single point of
reference. Nope, I don't know of one. But somebody probably has one
somewhere.
 
There are lists of zip code, town, long/lat data. As long as you can get
from zip code to long/lat, you can use trig to calculate the straight line
distance, assuming you can approximate to a flat surface, although slightly
more work will allow for the curvature of the Earth.
This list looks pretty comprehensive:
http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm
and sample code
http://www.zipcodeworld.com/samples/distance.vbs.txt

Or look into querying a suitable website. e.g.
http://www.zipinfo.com/cgi-local/zipsrch.exe?ll=ll&zip=77380&Go=Go

Also, accuracy may not be that high, as zipcodes are areas, but you would
have to assume a single point for calculation. There a discussion of some
salient points here:
http://www.webmasterworld.com/forum10/6530.htm

NickHK
 
You can definately do this if you have the lat/long of the zip centroid.

There are several website that will give you that.

Then you just set up a Macro in Excel to plot the distance between the 2
points.

If you google Excel Distance Macro, you should find it. If not let me know
and I will email you the script.

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top