Find Distance Between Zipcodes

G

Galsaba

I just downloaded the zip code database from ZipCodeWorld.
I want have (or write) a script that find distance between two zip codes.

Thanks,

Joe
 
G

Galsaba

I saw your post, I found there questions like the one I asked, but no
answers...

Joe
 
J

JulieD

Hi Joe

the * needs to appear at the end of the URL and then there's quite a few
links (32 threads) with solutions.
The best formula i found was an excel formula at
http://www.cpearson.com/excel/latlong.htm

----copy & paste from there
The formula to compute this distance is:



=RadiusEarth*ACOS(COS(RADIANS(90-(Lat1*24)))*COS(RADIANS(90-(Lat2*24)))+

SIN(RADIANS(90-(Lat1*24)))*SIN(RADIANS(90-(Lat2*24)))*

COS(RADIANS(24*(Long1-Long2))))



Where

Lat1 is the latitude of point 1, entered as DD:MM:SS.

Long1 is the longitude of point 1, entered as DD:MM:SS.

Lat2 is the latitude of point 2, entered as DD:MM:SS.

Long2 is the longitude of point 2, entered as DD:MM:SS.

RadiusEarth is the radius of the earth (3,963 miles or 6,377 kilometers).



The function above works only for points in the Northern and
Western hemisphere, where Latitudes and Longitudes are considered to be
positive. If you are mixing hemispheres, enter Northern and Western
coordinates as positive, and Southern and Eastern coordinates as negative,
and use the following formula:



=RadiusEarth*ACOS(COS(RADIANS(90-Lat1))*COS(RADIANS(90-Lat2))+

SIN(RADIANS(90-Lat1))*SIN(RADIANS(90-Lat2))*COS(RADIANS(Long1-Long2)))



In this formula, Lat1, Long1, Lat2, and Long2 must be entered as decimal
degrees (e.g., 45.5 rather than 45:30:00).

---------------------------------



however, it seems tha ACOS is not an available function in Access. The
second thread in that list provided an alternative way to calcuate the ACOS
part and

the following two urls (not checked) are also supposed to provide additional
information

http://www.freevbcode.com/ShowCode.Asp?ID=5532
http://www.movable-type.co.uk/scripts/LatLong.html


hope this helps

Cheers

JulieD
 

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

Top