Easiest way of downloading all Cities | Towns | Villages (as defined by OSM) in the world, specifically these attributes for each asked 22 Mar '16, 19:41 kuroshhashemi aseerel4c26 ♦ |
OverpassTurbo will probably never work when you want to download all cities in the world. Take a look at the answer on gis.stackexchange It says (with some extra details)
(Edit: this was a comment before) answered 24 Mar '16, 06:01 escada 1
Thanks, I would like to do this but I don't have space for the 500GB file
(24 Mar '16, 23:12)
kuroshhashemi
In that case you will have to split the task is smaller steps. e.g. per continent or even per country for the larger continents. Download a smaller file, obtain the cities from it. Throw away the file, repeat for another file. Another remark, not all cities will have the tags is_in. It is not uncommon to rely on the containment of 2 features to determine the is-in relation. Maybe you can explain what you want to achieve with the list of cities, there might be another solution besides downloading the list. (Are you sure you can handle the amount of data you will get ?)
(25 Mar '16, 04:31)
escada
@escada My application needs a CSV with each line a city and the metadata I bulleted above as columns in the file. Each city has a webpage that displays among other things city name and population (if avail from OSM). Each city has to be associated with country (and US State if in US) for search. I currently have such a file from geonames.org and want to swap out with OSM. It is probably 95% OK but from testing on Overpass Turbo I can see OSM has a more complete collection (and I trust their data better)
(25 Mar '16, 18:54)
kuroshhashemi
|
https://wiki.openstreetmap.org/wiki/Overpass_turbo will help you - and maybe someone else here, too :-) answered 22 Mar '16, 20:07 aseerel4c26 ♦ 1
Hi, I've tried Overpass Turbo and my request times out even after I increase the timeout period. Also although I can pull Cities |Towns | Villages (for the map bounding box as a test), I can't figure out how to get just the fields described abobe
(23 Mar '16, 14:33)
kuroshhashemi
1
@kuroshhashemi: Oh, I did not guess that it cannot handle that amount. Well, okay, on a second thought all villages may be a bit too much. Yes, by default you get all data for each object - maybe that could be restricted with some advanced Overpass API command, I do not know.
(23 Mar '16, 21:02)
aseerel4c26 ♦
1
For a single country: http://overpass-turbo.eu/s/fed This produces a CSV list only (will not display on the map) restricted to name, position, and place. It takes about a minute, and it should be straightforward to write a script iterating over all countries.
(24 Mar '16, 17:45)
Roland Olbricht
Thanks @roland-olbricht, yes I was thinking whether to workaround by splitting into smaller files like this... So many countries though =)
(24 Mar '16, 23:11)
kuroshhashemi
|