Welcome Guest, Not a member yet? Register   Sign In
A Good Zip Code Database Schema
#1

[eluser]Xeoncross[/eluser]
I found a couple of them but I was wondering if anyone knows a more current copy of the USA (or even better "western world") zipcodes. free-zipcodes.com has a descent(?) copy from 2006 - but I don't want to start with it if there is something better.

I also found these:
micahcarrick.com
phpclasses.com/522
phpZipLocator
populardata


Quote:From Elvix

Another solution to buying a Zip code DB is to use Google Map’s geocoder. I extracted the geocoding functions from a CI-enabled Google Maps API library I found, and just do queries for the Zips as they’re needed, saving the results in a DB table so I don’t have to look them up again. Works great and handles US, Canada, Japan, Europe—well, anywhere Google goes. - http://ellislab.com/forums/viewthread/78436/#393541

Anyone have some advice?
#2

[eluser]kevinprince[/eluser]
Firstly Welcome to CI Xeonross.

The problem with getting postal code information (thats zip codes, post codes, zonal codes), is it is usually owned by the mail service. In the United States thats the USPS, and in the UK its the Royal Mail.

In the UK we have the ability to pay for various ways to access this data, we can get the full PAF file for a few £k's or you can pay a 3rd party, a few pennies for every lookup you want to do.

The US is different and im sure there is a web service for US info. It depends how much info you want.

For city and state look at

http://www.webservicex.net/uszip.asmx?op=GetInfoByZIP
#3

[eluser]Xeoncross[/eluser]
Thanks, but for now I would rather skip the pay-per-use services as this isn't worth any cash yet.

Also, thanks for the welcome. Wink
#4

[eluser]slowgary[/eluser]
@Xeoncross... did you ever settle on a zip code database? I'm in the market as well. I thought I had a good one but I just noticed it's missing some and I can't tell how many. I plan to use the free-zipcodes.com table unless you've found something better. Thanks.
#5

[eluser]idealws[/eluser]
Hello,

I am new here to the forums as well as CI, but I am finding it to be very useful.

I noticed this thread about zip codes and figured I would give you what I have in hopes
it will be some help to you.

In the zip file you will find US zip codes something like 42,624 I believe it is complete.
Also I have included the Zipcode.php class that was listed in the wiki on this site.
I have modified the class to work with the database I have attached here. I hope this helps
those of you in need.

To use the class upload it to the library folder and call like so in your controller:

Code:
$this->load->library('zipcode');

After it has been loaded you can use it like this:
Code:
// Get the zip codes in range my miles
$this->zipcode->get_zips_in_range('92505', '10');

// Get the distance between two zip codes
$this->zipcode->get_distance('92505', '92555');

// Get the points for a zip code lat and lon
$this->zipcode->get_zip_point('92557');

// Get the zip details, lat, lon, city, stateprefix, state, county, areacode, timezone
$this->zipcode->get_zip_details('92557');

I think that pretty much sums it up. Again I hope this is some help to
those of you that were looking for a solution like myself.

Link to files: Download zip file

Regards,
Ray
#6

[eluser]chuckleberry13[/eluser]
Thanks for sharing that zipcode database. It's exactly what I needed!
#7

[eluser]chuckleberry13[/eluser]
I needed a database table that would allow me to lookup the timezone based off of a US zipcode, and idealws provided table almost did that. It had a timezone field, but they weren't true timezone ids that are required to use PHP 5 built in timezone functions. (i.e. were Eastern instead of America/New_York)

So I took the time to change all the timezones so that they are true timezone id labels.

Here is the database table (MySQL) in case anybody else could benefit from it.

Download US Zipcode Table (PHP 5 timezone labels)
#8

[eluser]Unknown[/eluser]
ZIPCodeWorld.com has a free download for their US ZIP code database. You can get it at http://www.zipcodeworld.com/zipcodefree.htm .
#9

[eluser]pixel888[/eluser]
Check out our script also http://www.php4script.com/store-locator-script/




Theme © iAndrew 2016 - Forum software by © MyBB