Jump to content

ZIP Code Distance


usadarts

Recommended Posts

What I need to do is the following:

Someone enters in a ZIP code and I bring up a list of the 5 closest league in the country to that ZIP code. Is this possible with php or any other programming or is their software that needs to be bought?

Thanks,
David
Link to comment
Share on other sites

[!--quoteo(post=366846:date=Apr 20 2006, 10:54 AM:name=usadarts)--][div class=\'quotetop\']QUOTE(usadarts @ Apr 20 2006, 10:54 AM) [snapback]366846[/snapback][/div][div class=\'quotemain\'][!--quotec--]
What I need to do is the following:

Someone enters in a ZIP code and I bring up a list of the 5 closest league in the country to that ZIP code. Is this possible with php or any other programming or is their software that needs to be bought?

Thanks,
David
[/quote]

You will need to have a list of all the "leagues" as well as the ZipCodes they are in, and a database of locations, preferrably with Longitude and Latitude coordinates. Then you will have to take the given ZipCode and gradiually add distance to the radius of the ZipCode.

I think the longitude/latitude to miles conversion is something like 62:1.

The hard part of all of this is the location database.
Link to comment
Share on other sites

you can get a zip code database here

[a href=\"http://civicspacelabs.org/home/releases/civicspace/civicspace-0.8.3.zip\" target=\"_blank\"]http://civicspacelabs.org/home/releases/ci...space-0.8.3.zip[/a]

download it, extract it, and look through the folders for the zipcodes.sql file or something like that
you'll have to INSERT them like 400 to 600 at a time on your MySQL server
depending on your CPU speed.

but that's a place to find the zipcodes

and there a plenty of free script templates for distance
most all free
it's about 7 or so lines of code
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.