Hi OSMappers,

I'm using overpass to get all the suburbs of a city. I can do it by setting this option:

area[name="CITY NAME"]

but what I want to is to get the infos by the ID of the city instead. Is it possible to do something like this?

area[id="CITY ID"]

This is my actual url:

http://MY-URL.com/api/interpreter?data=[out:csv(::type,"place",::id,"name",::lat,::lon)];area[name="CITY NAME"][admin_level=8][boundary=administrative]->.RESULTS;rel(pivot.RESULTS);node[place="suburb"](area.RESULTS);out;

Thanks in advance!

asked 11 Jun '17, 10:26

carapace's gravatar image

accept rate: 0%

If by city id you mean an OSM id for an object representing a city, there is a mapping between OSM ids and Overpass areas. There is decent discussion of how it works in the documentation: http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_area_.28area.29

permanent link

answered 11 Jun '17, 14:15

maxerickson's gravatar image

accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 11 Jun '17, 10:26

question was seen: 4,570 times

last updated: 11 Jun '17, 14:15

powered by OSQA