There are a variety of companies that offer both free and subscription databases of US zip codes and their GPS coordinate. Do a google search for zip code data and you will find formulas and databases.


A reminder, the GPS coordinate of a zip code is defined as the relative middle of that zip code, so the distance between 2 zip codes is between each one's mid-point. Zip code areas are not round or similar in size, so the actual distance between 2 places that may be right across the street from each other but in different zips may calculate as a few miles.

Bob Coalter
InterNet Partners, Inc.





At 11:01 PM 3/27/03 -0600, you wrote:

http://www.melissadata.com/

They have an address validate that is updated quarterly. One of their
products returns Longitude and Latitude up to six decimal places. Once you
have longitude and latitudes of two points on the globe you can find the
distance as the crow fly's via a simple formula. Use this formula plugging
in the longitude and latitudes:


180/Pi() * (ACOS ((SIN(Pi()/180*lat) * SIN(Pi()/180*#lat2#)) +
(COS(Pi()/180*lat) * COS(Pi()/180*#lat2#) * COS(Pi()/180*ABS(-Abs(lng) -
#long2#))))) * 69.11)

This is just pasted from a MS-SQL Server query, being passed CF variables
for lat2 and long2, that has lat and lng columns with the value of the
starting point in it. Simply replace all the lng and lat's with #lat1# and
#long1# variables to make it not come from a DB, or have columns for lat2
and long2.
Or you can rewrite it in your language of choice, most math functions are
pretty standard throughout, although SQL Server and CF vary a little.


There is also another one that I have used before that is less than $150 a
year, but I do not remember it's URL off the top of my head. It says it's
the one that Yahoo uses. It's a real ugly site but very good data, but I
forgot it's name and I cannot access my work machine right now to get the
bookmark (if I still have it)
Or I'm sure there are a lot of off the shelf products that will do this
also. It's late, I just hope I didn't type something wrong:)


Jacob Cameron

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Jason Baird
Sent: Thursday, March 27, 2003 5:58 PM
To: [EMAIL PROTECTED]
Subject: zip codes


Find the closest store application...


Working on a "find a store near you" type of application.

Anyone have any tips on this sort of thing? Must be a database of the zip
codes and how they relate to one another in proximity out there somewhere...

Jason Baird
WebOutsourcing.com
http://www.weboutsourcing.com
214-570-8336



-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe:
   Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org


----------------------------------------------- To post, send email to [EMAIL PROTECTED] To unsubscribe: Send UNSUBSCRIBE to [EMAIL PROTECTED] To subscribe / unsubscribe: http://www.dfwcfug.org




--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/03

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/03

Reply via email to