openmundi / world.db

Free open public domain world database 'n' schema for use in any (programming) language (e.g. uses plain text datasets)
Creative Commons Zero v1.0 Universal
570 stars 54 forks source link

brazilian citys #6

Closed williamgueiros closed 11 years ago

williamgueiros commented 11 years ago

hello i am from brazil and i don't have problem to add all states and city from brazil in you database.. now i don't wanted this solution but if you like, i add it for you... do you like this idea?

geraldb commented 11 years ago

Sure. Of course, you're welcome. I'd suggest using a file such as br/cities.rb Cheers.

williamgueiros commented 11 years ago

hello now i have 9968 cities name from mail system in brazil but my country we need states so select the city. do you have problems for this change??

https://github.com/wilbil/world.db/commit/73d3f1604f5938e78a0f3ec7e2a2c818c15dfd21

do you like this structure?

geraldb commented 11 years ago

See comment on your commit. Looks good. I added support for tags yesterday. In your case I would use the states as regions and use the region (s,se,co,etc.) as tags. Let me know if that makes sense and works for you. Example:

taubate,      Taubate,       region:sp,   se
saopaulo,   Sao Paulo,   region:sp,  se
williamgueiros commented 11 years ago

you had a great idea... do you like putting all of city from brazil in your base may be 9968 cities name ?? if you like idea, i'll put all in the next commit

geraldb commented 11 years ago

See the commit 1ef743de9bbc8b87d58e401d996fc82faa55da1f Added all your tags, regions and cities as plain text fixtures. Sure. Go ahead. Please use the new plain text format for cities.

williamgueiros commented 11 years ago

Ok sorry i don't see before it.

geraldb commented 11 years ago

No worries. Just added it yesterday and today. Thanks for your additions. Cheers.

williamgueiros commented 11 years ago

next step, how i am send the lat long and number of people in cities, using your layout?

geraldb commented 11 years ago

That would be fantastic. For the number of people, that is, population, just add a column with numbers e.g.

assisbrasil,    Assis Brasil,   region:ac,  4545454, n
brasileia,  Brasileia,  region:ac,  45343, n

Note: The tags column (e.g. n) must be the last entry. Order of region and pop can be in any order. First entry must be key and second title.

geraldb commented 11 years ago

For adding lat, long I'd suggest adding it in a new file called br/cities.geo.txt

Use key, lat, long per line e.g.

assisbrasil,    <lat value>, <long value>
brasileia,  <lat value>, <long value>

Let me know if that makes sense. Thanks for your efforts. Cheers.

williamgueiros commented 11 years ago

but in brazil i have match cities with the same name but in different region. how i can resolve this problem using cities.geo.txt layout ?

geraldb commented 11 years ago

Good point. Sorry. I'd say we add the key for the state (admin region) upfront. Thus,

assisbrasil,    <lat value>, <long value>
brasileia,  <lat value>, <long value>

becomes

ac.assisbrasil,    <lat value>, <long value>
ac.brasileia,  <lat value>, <long value>

Let me know if that works for you. Cheers.

geraldb commented 11 years ago

Whenever you're ready. Cheers.