usadarts Posted April 20, 2006 Share Posted April 20, 2006 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 Link to comment https://forums.phpfreaks.com/topic/7954-zip-code-distance/ Share on other sites More sharing options...
utahcon Posted April 20, 2006 Share Posted April 20, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/7954-zip-code-distance/#findComment-29074 Share on other sites More sharing options...
Zane Posted April 20, 2006 Share Posted April 20, 2006 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 thatyou'll have to INSERT them like 400 to 600 at a time on your MySQL serverdepending on your CPU speed.but that's a place to find the zipcodesand there a plenty of free script templates for distancemost all freeit's about 7 or so lines of code Quote Link to comment https://forums.phpfreaks.com/topic/7954-zip-code-distance/#findComment-29111 Share on other sites More sharing options...
usadarts Posted April 20, 2006 Author Share Posted April 20, 2006 Excellent....thanks everyone..... Quote Link to comment https://forums.phpfreaks.com/topic/7954-zip-code-distance/#findComment-29115 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.