Hi can I can get the cites with geographic locations and populations.

This question is marked "community wiki".

asked 31 Jan, 19:58

Ramzan243's gravatar image

Ramzan243
1113
accept rate: 0%


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.

permanent link

answered 05 Feb, 12:17

H_mlet's gravatar image

H_mlet
1.6k730
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×22
×7
×5

question asked: 31 Jan, 19:58

question was seen: 213 times

last updated: 05 Feb, 12:17

powered by OSQA