Jump to content

ZIP Code Distance


usadarts

Recommended Posts

[!--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
https://forums.phpfreaks.com/topic/7954-zip-code-distance/#findComment-29074
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
https://forums.phpfreaks.com/topic/7954-zip-code-distance/#findComment-29111
Share on other sites

Archived

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

×
×
  • 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.