views:

461

answers:

4

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

+2  A: 

The Carmen plugin is almost certainly what you're looking for.

Joe
Yes, I checked it out as well. I found what i needed though. Worth checking it out ( details below ). Thanks
Rishav Rastogi
+2  A: 

This will take a little legwork and data munging, but it's not too bad.

Countries and country codes are easy to come by. Sounds like you already have them.

Not all countries are divided into states. You may have to simply address these one by one-- there may be some combined reference, but not that I know of.

U.S. cities are available, and look for things like FIPS codes. There are commercial data providers that will provide you clean, well-organized data, but they are charging for it.

The post office has some databases with all the zip codes. Note that these charge periodically, and a single zip code doesn't imply a single single (far from it!). And it may not be necessary to actually have a database of all of them, as there are zip verification/correction services available for free.

For loading the data, check out a recent railscast on the subject.

ndp
Thanks,I found what i needed. Worth checking it out ( details below )
Rishav Rastogi
+2  A: 

Thanks Guys,

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

http://27.org/isocountrylist/iso%5Fcountry%5Flist.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%5Finclude

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.

Rishav Rastogi
A: 

GeoDataSource.com does have a very comprehensive database which has all those data. Be warned though that it is massive and you may have to filter quite a lot of data out before you can use it.

On the other hand, they have recently come up with the World Major Cities Database which is not everything but still has most of the major cities.

Kurosaki