Archived

This topic is now archived and is closed to further replies.

GroZZleR

Postal / Zip Code Regional Algorithms?

Recommended Posts

I''ve googled (and found something about the NAC which was pretty neat) and googled, but I can''t seem to come up with anything. You know how dating services can take your zip or postal code, and find anyone with X km / m of your location? Is there any published webpage on the algorithms to determine this? I can''t seem to find anything. Any help is welcome here, thanks.

Share this post


Link to post
Share on other sites
Unfortunatly, Zipcodes are not distributed evenly, and not always in an orderly manner.
The first number increases heading west. 22554 is in Virginia, and 90210 is in California. The next two digits usually corrospond to a district. Some districts have more numbers, some share them. #25## is in the Richmond district.
The final two digits are an individual office. Some offices deliver to multiple zipcodes, and most sets of Post Office Boxes have their own zipcode.
You can make some assumptions. If the first three numbers are the same, chances are they are pretty close. The numbers closer to the right are more chaotic - that is, where they are placed on a map is less predictable. The USPS leaves numbers open for growth, but sometimes they run out and have to leap thirty or fourty numbers for a new zipcode.

Yes, I am a postal worker. :D

Share this post


Link to post
Share on other sites
I used to work for a web mapping service (Vicinity.com), so I have a pretty good idea about this kind of thing, and nobodynews is right. There isn''t an algorithm, really, it is all database driven.

When comparing distances between two zipcodes, what they do is have a database that contains all the zipcodes mapped to the latitude and longitude of the center of the zipcode (they buy these databases from map data companies, like Etak).

The just look up the zip, take the lat/lons of both and do a very simple distance formula between two points, the same one you probably learned in basic 8th grade or high school math.

( See: http://www.purplemath.com/modules/distform.htm )

Share this post


Link to post
Share on other sites
If you just want the zip centroids and not full address maps, you can get them pretty cheaply. Check out these folks:

http://www.zipcodedownload.com/

Share this post


Link to post
Share on other sites