Jump to content

Archived

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

usadarts

ZIP Code Distance

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.