Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All Countries States Cities and Zipcodes in a Application

Is there a way getting all countries, states,cities zipcodes/ in one single database.

I have been looking all over.

I discovered geonames.org, which has I guess all of the content. But there is no way to fetch that data directly.

I am using rails. If there any helpers or Plugins, it'd be great. It would be awesome if there is a complete resource in any parsable format which I can use to get this database in place.

Please recommend if you any thanks

I do have the iso country code list but no States for some countries.

Thanks in advance

like image 992
Rishav Rastogi Avatar asked Sep 22 '09 21:09

Rishav Rastogi


People also ask

Do ZIP codes exist in every country?

Most countries have a postcode system which indicates the delivery zone or office. When a letter is sent to a given country, it needs to be addressed correctly and with the postcode in the position required by that country. However, some countries do not have a postcode system or have one but do not use it.

Is zip code only in USA?

About US ZIP Codes. US ZIP codes are a type of postal code used within the United States to help the United States Postal Service (USPS) route mail more efficiently.

Which countries do not have ZIP codes?

Aruba, Bahamas, Togo, Tokelau, Tonga and many others have no ZIP codes. Very little island countries never needed ZIP codes. Some little countries use postal codes from country around, for example San Marino and Vatican city use Italy postal code system.

What is an example of a postal code?

A United States postal code, for example, might be either five digits or five digits followed a hyphen (dash) and another four digits (12345-1234).


1 Answers

Thanks Guys,

I got all the the countries and states of all of them, but no zip codes.

http://27.org/isocountrylist/iso_country_list.sql

This contains all countries, and there iso-3166 codes ( Siberia code needs to be changed from "CS" to "RS")

And here is the FIPS file for countries with states

http://www.maxmind.com/app/fips_include

For zip code validation I am using

http://www.geonames.org webservices

There is a geonames ruby gem as well, which makes it really simple to do zipcode validations

Hope that helps anybody who needs this information, worth keeping it handy for web projects.

Another Link ( thanks @laise ): http://dev.maxmind.com/static/csv/codes/maxmind/region.csv

like image 195
Rishav Rastogi Avatar answered Nov 06 '22 00:11

Rishav Rastogi