View Full Version : Calculate distance between two zip codes
David Abramowitz
12-28-2002, 03:55 PM
You're going to need one hell of a table. Essentially you will need the latitude and longitude of every extant zip code. From there it's just a question of math. If such things already exist as canned PC subroutines, it may be worthwhile to wrap it in JAVA, or VB, and then use STRPCCMD, or RUNRMTCMD from your AS/400 program to obtain the results. Dave
D.Handy
12-28-2002, 06:28 PM
Stevie, First, you're going to need a database of current zip codes and their nominal midpoint latitude and longitude. Amazingly, this is not available free from any source (to my knowledge) although lots of places sell it. New databases are available every month. The US Census does have a free database available, but it is from their 1990 census. It has only around 29,470 records whereas there are around 43,000 current zip codes (or over 76,000 if you count zip codes with more than one city / county name assigned). The free 1990 database is at http://www.census.gov/geo/www/gazetteer/places.html if you are interested. Use Google to find sites that sell more recent databases; there are lots of providers with prices all over the map, so to speak. Once you have the database, it is just a matter of doing the math. One site with the forumlas is http://williams.best.vwh.net/avform.htm which has lots of aviation related formulas. Including great circle distance calculations. Doug
Guest.Visitor
12-30-2002, 09:43 AM
Thanks!
Guest.Visitor
12-30-2002, 11:51 AM
Hello: I'm working on a project where I need to find the distance between two zip codes. Has anyone done something along this line in RPG? Any help you give me will be appreciated. Kind Regards, Stevie Burden
Guest.Visitor
12-30-2002, 11:51 AM
Try ZIP/CITY from WorksRight software, www.worksright.com. Their site says: A distance calculation program is included that calculates the air-line distance between two ZIP Codes. The distance is calculated based on the average latitude/longitude of the post office serving the specified ZIP Code. It's $395, or $495 in 2003, with free monthly updates. We've used it just to keep our telephone area codes accurate.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.