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
HTMLPad 2018 15.5
WeBuilder 2018 15.5
SentiMask SDK Trial 2.0.0
Track Order For Magento 2 1.0.0
Calendar 365 For Dynamics CRM 4.0
Scimbo 1.2
Odoo Furnito Theme 1.0
.Net Assemblies/WSDL Import Utility for Delphi 6.0.4.0
Devart Excel Add-in for Zendesk 1.7
Excel Add-in for Marketo 1.7
GetOrgChart 2.5.3
AnyGantt JS Gantt Charts 8.6.0
AnyChart JS Charts and Dashboards 8.6.0
Multi Vendor Ecommerce Script & Apps 4.0
Magento 2 Inventory Management Extension 1.0
Top Code
MCU 8051 IDE 1.4.7
HTMLPad 2018 15.5
BedRock IDE 1.0
Email Grabber
jQuery Slider Ken Burns 1.0
Guest Book V. 2 V2
XML Products Showcase Slider 1.0
ActivePerl 5.8.4.810/5.6.1.638
Azizi search engine script PHP 4.1.10
Adaptive multi-focus image fusion using a wavelet-based statistical sharpness measure 1.0
STDF file reader 1.0
Hotel Management - Full Board Version 6.55
The Karma Language 1.0
jQuery Accordion Photo Gallery 1.0
RLS Algorithm Demo 1.0
Top Rated
VisualNEO Web 2018.12.15
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
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
PHP GZ Blog Script 1.1
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: 32
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: 32



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