Jump to content


Photo

ZIP Code Distance


  • Please log in to reply
3 replies to this topic

#1 usadarts

usadarts
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts
  • LocationLaurence Harbor, NJ

Posted 20 April 2006 - 02:54 PM

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

#2 utahcon

utahcon
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 20 April 2006 - 06:11 PM

[!--quoteo(post=366846:date=Apr 20 2006, 10:54 AM:name=usadarts)--][div class=\'quotetop\']QUOTE(usadarts @ Apr 20 2006, 10:54 AM) View Post[/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.

#3 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 20 April 2006 - 07:15 PM

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

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#4 usadarts

usadarts
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts
  • LocationLaurence Harbor, NJ

Posted 20 April 2006 - 07:21 PM

Excellent....thanks everyone.....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users