views:

44

answers:

1

Hello,

I'm currently modelling the user profile of my current project (in Rails btw). The user should be able to set the country, state and city he lives in. Instead of doing this through simple input fields I'd like to have some - kind of - nested selection boxes.

I think of it like this: first select your continent. Then a list with the countries of the selected continent appears. Then choose a state based on the selected country. etc.

Do you know a database schema with the required data? I'm pretty sure something like this must exist - I just can't find it! ;)

Optimal case would be, if the names of countries and cities are already in localized state. I think it's quite comfortable for the user to select his home location in his native language! ;)

Thanks for your helpful answers!

+1  A: 

you should check out Geonames. they might have what you are looking for. also, you can download their data (for free) for local access.

Importing the Data into SQL Server
Google reveals some helpfull "how-to's" on importing the data into SQL server...

http://johanneskebeck.spaces.live.com/Blog/cns!42E1F70205EC8A96!3782.entry

http://blogs.msdn.com/edkatibah/archive/2009/01/13/loading-geonames-data-into-sql-server-2008-yet-another-way.aspx

http://forum.geonames.org/gforum/posts/list/847.page

Muad'Dib
Hi Chris, yep, the data can be downloaded and is sure useful, but I didn't found it as SQL - can it be found there too?
Joe