Hi can I can get the cites with geographic locations and populations.
This question is marked "community wiki".
asked 31 Jan '20, 19:58 Ramzan243 |
Hi. It's quite easy to find cities of a limited area, with this request on overpass-turbo (build in one click using the wizard). But for the whole world it's really hard on the server and browser, Overpass is not meant for worldwide requests. The result will be hard to parse, as most cities are nodes, but some are relations, hence to get the coordinates, you'll have to compute form the relation members. Also in OSM the population tag is not really reliable, mostly used for rendering and search results ordering. You should probably use wikidata, either through the wikidata tag, or directly using theirs tools (SPARQL query service). From an example and removing the 100 limit, I got 23128 cities, with population, using that request. Beware, it takes some time to compute, and some more to render. Hope this helps. answered 05 Feb '20, 12:17 H_mlet |