Important alert: (current site time 7/15/2013 11:16:36 AM EDT)
 

winzip icon

Zip code (zipcode) range and distance calculation class v1.1.0 (*** UPDATED! Much Faster!)

Email
Submitted on: 4/13/2005 6:05:43 PM
By: Micah Carrick  
Level: Intermediate
User Rating: By 3 Users
Compatibility: PHP 4.0
Views: 11728
(About the author)
 
     This is a PHP class to do various calculations with zip codes. It's primary purposes are to calculate the distance between two zip codes and to extract all the zip codes that are within a range of a given zip code. All calculations are based on lattitude and longitude coordinates stored in the database. Included is a class file, demonstration file, and the sql files required to create and populate the MySQL tables. ** UPDATE ** Added code to make the function which get's a range of zip codes execute ALOT faster. Went from 3.2 seconds to 0.42 seconds! Modification was submitted by Jeff Bearer

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

4/14/2005 10:03:07 AMAshraf Magdi

Micah is Really Good work & Hard to collect Zips SQL , and i apperciate thats and i give you 5 global !!
(If this comment was disrespectful, please report it.)

 
4/14/2005 11:50:16 AMMicah Carrick

Thanks. Just an FYI, to give credit due where deserved, the zip code database was originally from a text file compiled by the author at this website:

http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm

I just converted it to MySQL and made some minor modifications to the structure and created the state table.

Thanks for the feedback!

Micah
(If this comment was disrespectful, please report it.)

 
5/2/2005 5:31:40 PMMicah Carrick

Wow, contest winner! Awesome! Thanks guys! And thanks to Jeff Bearer for the piece of code which made the find zips in range function run so much faster! This has alot of exclamation marks! Yes it does!

- Micah
(If this comment was disrespectful, please report it.)

 
11/21/2005 2:49:15 PMNathan A. Huebner

Excellent code-To the maker / people who put this on PScode, I think you deserve a serious 5 globe award from PSCode. This is precision coding man! Not only that, but the data that came with it, is priceless to me, as I would end up having to pay some company for it. It's going to be used to detect the closest warehouse to my customers, based on 4 warehouses in different states. It's going to work nice, now I can compare ZIP Codes! THANKS AGAIN! 5 GLOBES - A++++
(If this comment was disrespectful, please report it.)

 
12/14/2006 3:43:35 PM

good
(If this comment was disrespectful, please report it.)

 
2/20/2007 2:37:59 AMBagesh singh

hello

this programm is very good and it is very usefull
thank u
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.