Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Uber for Massage 2.0
Job Board Software 1.1
RentALL - Airbnb Clone | Built with ReactJS 2.6
VB.Net PDF 2020.6.0
Flowrigami 1.0.0
SentiVeillance SDK Trial 7.3.2020.03.02
Entity Developer 6.8
dbExpress driver for SQLite 4.2
dbForge SQL Complete 6.5
Advanced Amazon Clone App 2.0
Appjetty Delivery Date Manager 1.0.0
The C# Barcode Library 2020.5.0
Chowtro - Online Restaurant Food Ordering Software 1.0
Alvas.Audio.Core 2019.0
Sainsburys Script 1.3.2
Top Code
dbForge SQL Complete 4.8
dbExpress Driver for SQLite 3.9
Availability Booking Calendar PHP 1.0
ATN Site Builder 3.0
PostgreSQL Data Access Components 4.4
ATN Resume Finder 2.0
PHP Review Script 1.0
ICPennyBid Penny Auction Script 4.0
Invoice Manager by PHPJabbers 3.0
Classified Ad Lister 1.0
SentiVeillance SDK Trial 7.3.2020.03.02
Aglowsoft SQL Query Tools 8.2
Solid File System OS edition 5.1
Deals and Discounts Website Script 1.0.2
Azizi search engine script PHP 4.1.10
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
Calculating the distance between zip codes 
File ID: 66167






Calculating the distance between zip codes 
Download Calculating the distance between zip codes http://code.activestate.com/recipes/546525-dictionary-class-list-indexes-into-database-query-/Report Error Link
License: Freeware
Downloads: 33
Submit Rating:
Calculating the distance between zip codes  Description
Description: I came across the mention of a formula labeled "The Great Circle Distance Formula" that purported to calculate the distance between any two points on the earth given their longitude and latitude points (the reference was in a Linux Magazine article). So, I looked up some information and cooked up a Python version of the calculation. There are references in the code where you can obtain approximate zip code data for free (e.g., if you wanted to enhance your website by adding a "Search within x mi's" feature), as well as references to the GCDF if you have further interest. Enjoy!

04/25/2006 update: I've decided to update this recipe with an object oriented bent where the information is cached once the object is instantiated. I've also added command line access to automatically download the zipcode file from the census website (just use 'python zips.py -d' and it will download a copy to your harddrive under 'zips.txt'). Lastly, I've added some unit testing so that if any future changes are made this will automatically run and tell me if anything pops out as wrong.

License: Freeware

Related: Web

O/S:Windows

Downloads: 33



More Similar Code

Geozip Calc Distance Between Zip Codes is Unix compatible. Calculates distance between zip codes in the US or finds zip codes within a given distance. The sub-routines included can be used to calculate distance between latitude and longitude coordinates.



The solution to the problem of calculating the distance between an ellipse and a point is less than straightforward. The problem can be solved analytically however, which boild down to solving a quartic equation in cos(f), with (f) the true...



Vincenty published an algorithm for calculating the distance between two latitudes and longitudes and another to find the destination latitude and longitude, given the start coordinate, bearing and distance



Holdem Tools is a web based Texas Holdem odds calculator.

The front end is generated using PHP and javascript and makes use of the scriptaculous library. The backend is powered by the poker-eval aZipdy is a program for calculating the...



This code outputs the distance between 2 GPS points showing also the vertical and horizontal bearing between them. This code was originally made for an Automatic Tracking Antenna Aimer. If you find it useful please take note of the owner. If you...



M-file to calculate the distance between two points on the earth surface, using different ellipsoid parameters.



In 1975, Vincenty published a rapidly converging algorithm for computing the distance between points on an ellipsoidal earth. The algorithm is precise to within a few millimeters. Since then, his algorithm has since seen significant implementation...



This program calculates the distance between two locations (latitude and longitude) using the Haversine formula. The Haversine formula gives the shortest distance between two points over the earth's surface, ignoring elevation, hills, etc...



Allows to control the distance between subplots, add labels on rows/columns only and more.
% simple example:
subplot1(2,3);
subplot1(1); plot(rand(10,1));
subplot1(2); plot(rand(10,1));



Normally boxplot plots the whiskers with a maximum length based on the distance between the 25th and 75th percentile. This script uses boxplot but plots the whiskers for a specified percentile and only plots the outliers beyond the new...

User Review for Calculating the distance between zip codes
- required fields
     

Please enter text on the image