• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Zipcodes within mileage

LEGEND ,
Oct 03, 2006 Oct 03, 2006

Copy link to clipboard

Copied

You know when you go on a search of some sort and they sometimes ask you for
your zip. Then when you submit, it finds items close to your zipcode
(surrounding cities)?? How do you do that?

--
Wally Kolcz
Developer / Support


TOPICS
Advanced techniques

Views

303

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 03, 2006 Oct 03, 2006

Copy link to clipboard

Copied

They have a database that contains zip codes and the longitude and
latitude coordinates of the center of the zip codes. They then use a
formula ranging from basic algebra to fancy calculus that takes into
count the curvature of the earth to find all other zip codes centers
within a given distance.

There are many sources of the zip code database from free to costly.
The formulas can easily be found on Google as well as step by step
tutorials on how to put it all together.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 03, 2006 Oct 03, 2006

Copy link to clipboard

Copied

I wrote an app a few years ago that tells distance between zipcodes. You need to have a table with all the zipcodes in it along with the Long and Lat of the zipcodes. If two zips are entered submitted, you just use the associated Lat & Long to calulate the distance between the two points. I think I got the zipcode database from the US postal service site.

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 03, 2006 Oct 03, 2006

Copy link to clipboard

Copied

Here is the code from cflib.org that calculates the distance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2006 Oct 03, 2006

Copy link to clipboard

Copied

awesome topic.

thx.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006

Copy link to clipboard

Copied

LATEST
Thanks Ian.

Incase anyone else needs it, I found a good database at:

www.cfdynamics.com/cfdynamics/zipbase/index.cfm
www.civicspacelabs.org/home/developers/download


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation