SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 40
Thread: Zipe Code Locator
-
Sep 16, 2002, 09:03 #1
- Join Date
- Sep 2002
- Posts
- 12
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Zipe Code Locator
I am looking for a zipcode locator function. I want to be able to search my database of locations between x mile radius of xxxxx zipcode. Does anyone know where i can find this?
Thanks
NeilKeep It Real
-
Sep 16, 2002, 10:34 #2
- Join Date
- Feb 2001
- Location
- Clearwater, FL
- Posts
- 3,615
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Something like this? http://zipfindlocator.com/default.htm
-
Sep 16, 2002, 10:37 #3
- Join Date
- Sep 2002
- Posts
- 12
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
been there, seen that, im looking for a free result. Or a free database. I have done some research and im sure i will be able to calculate the distances if i had the latitude and longitude of zipcodes. Simple Trig
NeilKeep It Real
-
Sep 16, 2002, 10:42 #4
- Join Date
- Feb 2001
- Location
- Clearwater, FL
- Posts
- 3,615
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
"simple" trig LOL
I will keep a look out for a free zip code database
-
Sep 16, 2002, 12:38 #5
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is want you want to build?
1. User enters zip code
2. Your database returns the position (x,y) of that zip code (in the middle of that area, I guess)
3. Add R miles to that position
4. Get all other zip codes with position within the radius R from (x,y)
(5. Get some other interesting information, e.g. companies having those zip codes)
I don't think you will find a free database
If you visit US Postal Services, you will find "The information you are seeking is not available via download but is provided through the National Customer Support Center at (800) 238-3150"
Other countries may give away the zip code info for free, for example the Faroe Islands
Reflection:
I think you should convert the Latitude/Longitude to a position in the US National Grid System, because the distance between two longitudes isn't the same on all latitudes
How to read USNG
National Geodetic Survey
-
Sep 16, 2002, 12:52 #6
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
And the distance between two latitudes isn't always the same ...
http://www.rovaniemi.fi/lapinkavijat...index_eng.html
"His aim was by measuring a degree of latitude along a line of longitude to investigate whether the earth was flattened at its poles."
And yes, of course I have been to the monument on the top of the Kittisvaara fell in Pello
-
Sep 16, 2002, 13:02 #7
- Join Date
- Aug 1999
- Location
- Lancaster, Ca. USA
- Posts
- 12,305
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Not only that but Zip Codes in the United States are not setup for a set area. They are based on Population density. Not only that where I live, we have one main post office which handles 4 different zip codes. One of those zipcodes is limited to post office boxes within the building.
To do what you want to do is a lot more than simple trig.
-
Sep 16, 2002, 13:31 #8
The Melissa software can do that (I believe) but it's certainly not free.
Owen
-
Sep 16, 2002, 13:34 #9
- Join Date
- Sep 2002
- Posts
- 12
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes i know, it doesn't have to be exact.
Thanks for all your help
Neil ConlanKeep It Real
-
Sep 16, 2002, 14:54 #10
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by W. Luke
Not only that but Zip Codes in the United States are not setup for a set area. They are based on Population density. ...
Isn't a map where the user can select a city a better idea? (And latitude & longitude for a city is easier to find)
-
Sep 24, 2002, 12:24 #11
- Join Date
- May 2001
- Location
- Northern Virginia
- Posts
- 445
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I think I may have what you need... Im working on finishing a similar database. What exactly do you need? I want to give back to this community who has been very helpful to me in the past.
-
Sep 24, 2002, 12:39 #12
- Join Date
- Jul 1999
- Location
- Jacksonville, FL
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What you are looking for can be found here. Data is from 1990 Census (that's what you get when the price is $0):
http://spatialnews.geocomm.com/newsl.../zipcodes.html
Scroll down to US Census. It's a zip file containing a comma separated values file (saved oddly as .txt). You'll need to import it into your DB, then do the math.
If you want to buy an updated database, I've seen it as low at $40. Google is your friend.
Let me know if you need help with the math -- I've got some VBScript lying around here somewhere that'll do the trick and if you use a different lang. -- no prob, the concept translates.
Have fun!
Shawn
-
Oct 15, 2002, 12:45 #13
phpclasses.org has some classes, code and sample data on how to do this.
visit phpclasses.org - search for zip
see what you find
m00
-
Oct 15, 2002, 12:55 #14
- Join Date
- May 2001
- Location
- Northern Virginia
- Posts
- 445
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Couldnt find the code on phpclass.org, but since I already wrote the code myself its cool.
On another note, how does that site highlight a row in a table when i mouseover that row?
-
Oct 16, 2002, 00:56 #15
- Join Date
- Oct 2001
- Posts
- 2,686
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by jkh1978
On another note, how does that site highlight a row in a table when i mouseover that row?
http://www.sitepointforum.com/showth...threadid=50826
Hope this is what you're looking for?
-Helge
-
Oct 22, 2002, 04:00 #16
- Join Date
- Mar 2001
- Location
- Germany
- Posts
- 52
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i guess this will help you:
http://www.cryptnet.net/fsp/zipdy/
from the website:
Zipdy is a program for calculating the distance between two zip codes and finding all the records in a RDBMS with a zip code with x miles of another zip code. Currently, RDBMS support exists for postgreSQL. Additional future support for other databases will be added in future releases of zipdy.
Zipdy is free software released under the terms of the GNU General Public License. Zipdy was written in C but is also available in PHP and perl. It runs with data from the US Census Gazetteer program. The original Gazetteer data is available here. The data is from the 2000 census.
The distance calculations are made by doing a great circle calculation on longitude and latitude points provided by the census data. The result is returned in standard miles. If you need an explanation of what a great circle distance calculation is, click here.
Tom
-
Oct 26, 2002, 13:10 #17
Moved to a more appropriate forum
SeanHarry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
-
Apr 23, 2003, 07:50 #18
- Join Date
- Jul 1999
- Location
- Jacksonville, FL
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Seanf -- not sure where you moved this, but I got a question regarding how to calculate zipcodes ranges given latitude and longitude and I think it will be helpful here if anyone should search the forum for it:
Originally Posted by jsk137
I did mine in VBScript for an ASP application, but a couple minutes on Google (php zip radius) produced the following -- which is exactly what I found for ASP:
PHP Builder
and
dbforums
They both have good explanations. Here's my (rough) VBScript version fwiw (I'm leaving out declaring variables and actual sql):Code:'FIRST FIND THE LAT AND LON FOR THE ZIPCODE 'SUBMITTED BY THE USER 'SQL GOES HERE ' THIS VARIABLE SETS THE RADIUS IN MILES 'iRadius = 30 LatRange = iRadius / ((6076 / 5280) * 60) LongRange = iRadius / (((cos(cdbl(istartlat * 3.141592653589 / 180)) * 6076.) / 5280.) * 60) LowLatitude = istartlat - LatRange HighLatitude = istartlat + LatRange LowLongitude = istartlong - LongRange HighLongitude = istartlong + LongRange 'USE HIGH AND LOW LAT AND LON TO SELECT ZIP CODES 'THAT FALL IN THOSE RANGES 'SQL - select zip where lat <= lowlat and late <= highlat and long >= lowlong and long <= highlong
-
Apr 28, 2003, 16:41 #19
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just curious; that formula is based on the approximation that the earth is a sphere (not flattened)?
I mean, if I want to calculate something near the zip code for Santa Claus at the north pole, the formula will give me an (a bit) incorrect result?
2nd: The numbers (6076 / 5280) * 60 ? Are they supposed to be equal to 24900 / 360 (the length of 1° in miles) ?
-
Apr 28, 2003, 17:04 #20
- Join Date
- Mar 2001
- Location
- Philadelphia, US
- Posts
- 2,205
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
TuitionFree — a free library for the self-taught
Anode Says... — Blogging For Your Pleasure
-
Apr 28, 2003, 17:37 #21
- Join Date
- Jul 1999
- Location
- Jacksonville, FL
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by jofa
2. Yes again.
I know there are more accurate ways of doing this, but if you just need a yardstick, this is as good as any. I'd love to see this done with the new ZCTA's and such.
-
Apr 28, 2003, 17:39 #22
- Join Date
- Jul 1999
- Location
- Jacksonville, FL
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by anode
-
Jun 4, 2003, 21:15 #23
- Join Date
- Jul 1999
- Location
- Jacksonville, FL
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I wanted to follow up on this thread b/c I've figured out ZCTA's for a new project I'm working on. Thank the Census Bureau again for this gem.
Zip, Lattitude and Longitude in handy ascii format:
http://www.census.gov/geo/www/gazetteer/places2k.html
There are four files available. The one you'll be interested in is the ZCTA file.
"The ZCTA file contains data for all 5 digit ZCTAs in the 50 states, District of Columbia and Puerto Rico as of Census 2000. The file is plain ASCII text, one line per record."
Unfortunately, the ZCTA file doesn't have city/town/village names, just zip codes, lat, lon. AND, the schmucks didn't include the FIPS code so you can't import the places and zcta files into tables and join them to get the city/town/village name. Still, it's way more up-to-date than the 1990 data I reference above -- and, again, the price is right.
Enjoy!
-
Mar 4, 2004, 18:43 #24
- Join Date
- Mar 2004
- Location
- East Bay Area, CA, USA
- Posts
- 28
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ZIP Code data
I know this thread hasn't been touched upon for a while but I have a few files that contain all the zip codes (with city names and states) in the US (AK and HI included). I also have a piece of PHP code that creates a MySQL table with zip codes and LATS & LONGS. Is that what was being sought?
-
Mar 4, 2004, 18:48 #25
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Everah
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
Bookmarks