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

Given the id of a closed way which represents an area, as indicated by an "area" tag such as building=*, how can I retrieve all nodes/ways contained entirely or partially within that area from Overpass API?

What I have found so far is area-query, which sounds as if it should cover this use case, and it works as expected for areas represented as multipolygons (if you remember to add the magic number 3600000000 to the id):

<query type="node">
  <area-query ref="3600015228"/>

(Overpass Turbo)

I've found a hint that adding 2400000000 to the id might do the trick for closed ways. However, this does not appear to work:

<query type="node">
  <area-query ref="2501518744"/>

(Overpass Turbo)

This example query for way 101518744 should return 1172225070 as well as other nodes, but the result is empty. Is there something I'm missing?

asked 20 Mar '13, 18:40

Tordanik's gravatar image

accept rate: 35%

In short: an area for the given way has never been generated because the way has no name. I'm sorry that there is no immediate solution to your problem.

In more detail: contains the rules what objects are recognized as areas.

In particular, ways are selected there only if they have a name and one of various other tags (including "building=yes"). This ruleset isn't a fixed law, but rather reflects the discussion on the mailing list. It is likely to be incomplete anyway. Please send a mail to talk(at) to put the discussion further. I'll then expand the list when there is consensus that this is useful.

permanent link

answered 21 Mar '13, 08:22

Roland%20Olbricht's gravatar image

Roland Olbricht
accept rate: 36%

edited 21 Mar '13, 08:23

I've taken this to talk now, as you asked: Thread archive

(22 Mar '13, 20:03) Tordanik

Is there some changes/news regarding this question which seems important. It would be very useful to have the possibility to make queries using for exemple ways[landuse] without name.

Ex : Finding all residential buildings, all industrial buildings, etc. depending if they are included in ways with landuse=residential or landuse=industrial etc. but without any name. Most of the time, ways[landuse=residential] don't have name, then we can not use them as areas.

In my use, I need categories of buildings to determine activities surfaces (buildings) on ground. (Building attractions in terms of activities/population)

permanent link

answered 26 Nov '13, 16:45

glider90's gravatar image

accept rate: 0%


Problem localy solved for me with the installation of a local Overpass server on wich we changed rules for areas (/rules/areas.osm3s). Thanks for this usefull post.

(27 Nov '13, 13:14) glider90

FYI: There are now two similar GitHub tickets dealing with this issue:

(21 Apr '14, 10:54) mmd

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]( "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: 20 Mar '13, 18:40

question was seen: 9,548 times

last updated: 21 Apr '14, 10:54

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