Jump to content

Distance Between Zip Codes


zackrspv
 Share

Recommended Posts

So,

I was making a program to automatically show the distance between a client's START zip code, and that of the zip codes of our events. Since i made this script FIRST, to ensure that the math was working with the formulas i found online, I decided to make it a bit easier to read, and follow.

Basically, it uses the (somewhat hacked version, hehe) Haversine formula to calculate the distance across a sphere from the given zip code's latitude and longitude positions. The data is provided by the US Census bureau, and the file is required to run the program :unsure:

NOTE: As it's math, and not pulling from a secondary site, no, it's not 100% accurate; but, hey, it gets you the information rather close to the actual distance.

Instructions

Download ZIP Code DATA: http://www.census.gov/tiger/tms/gazetteer/zcta5.zip

Download the following script, and put BOTH files in the SAME DIRECTORY and run :P

What happens when script runs normally.

Posted Image

What happens when Zip1 or Zip2 is bad.

Posted Image

Enjoy!

dst.au3

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Link to comment
Share on other sites

Excellent Program, and an interesting way of calculating distance. When I first read the topic I assumed you would just pull information from MapQuest or Google Maps; Using Latitude/Longitude is an original way of doing it. :P

"The true measure of a man is how he treats someone who can do him absolutely no good."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...