NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

3
1

Is it possible to get all city nodes within a country using the overpass api? Preferably using relations rather than a bounding box.

If I have to do this using a bounding box, is it possible to get a country bounding box through the overpass api too?

https://help.openstreetmap.org/questions/13872/how-to-find-list-of-cities-in-a-state-with-overpass-osm-api shows how to do this within a bounding box. I would rather do this using relations to get a more accurate list of cities (especially since overpass doesn't appear to return a bounding box for the country node to start with)

asked 14 Jan '13, 04:32

rjmackay's gravatar image

rjmackay
61113
accept rate: 0%


The following overpass query returns the list of all cities in Belgium:

area[name="Belgiƫ - Belgique - Belgien"];(node[place="city"](area););out;

You can replace the name with any country (or other administrative level) you want. Areas are explained here: http://wiki.openstreetmap.org/wiki/Overpass_API/Areas

permanent link

answered 14 Jan '13, 04:47

escada's gravatar image

escada
19.0k16166302
accept rate: 21%

edited 14 Jan '13, 04:49

1

Brilliant, thanks! Areas are what I need and what I'd missed in the docs.

(14 Jan '13, 04:55) rjmackay

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:

×483

question asked: 14 Jan '13, 04:32

question was seen: 27,042 times

last updated: 14 Jan '13, 04:55

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum