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

I want to extract housenumber nodes that are contained in a closed way tagged with "building". I've been able to get the job done with OQ: it was a lucky shot, since I never ever used this syntax before. Now I would like to convert it to XML Overpass. I've tryed with no result (I'm having trouble with the recursion way). This is the query:

[bbox:{{bbox}}];
way[building];
node(w)["addr:housenumber"];
out meta;

asked 27 Nov '16, 22:05

Davide_sd's gravatar image

Davide_sd
61226
accept rate: 0%


There's a converter available:

http://overpass-api.de/convert_form.html

Note that this Overpass script will only find nodes which are members of the building way ('contained' to me implies that you also want to find unconnected addresses that are located inside the building).

permanent link

answered 28 Nov '16, 02:34

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

I want only the nodes that are members of the building way ! :)

Nice, a converter... Unfortunately the converted query doesn't work, Overpass runs out of memory.

(28 Nov '16, 10:17) Davide_sd

Ok, found it! I post the complete query: this return the nodes that are members of the building way and that have the addr:housenumber tag.

<osm-script>
  <query into="<Name of the city>" type="area">
    <has-kv k="admin_level" v="8"/>
    <has-kv k="name" v="<Name of the city>"/>
  </query>
  <query type="way">
    <area-query from="<Name of the city>" />
    <has-kv k="building"/>
  </query>
  <query type="node">
    <recurse type="way-node"/>
    <has-kv k="addr:housenumber"/>
  </query>
  <print mode="meta" />
</osm-script>
permanent link

answered 28 Nov '16, 10:34

Davide_sd's gravatar image

Davide_sd
61226
accept rate: 0%

edited 28 Nov '16, 10:42

There has been a recent similar query regarding extracting nodes within a closed way that may help.

permanent link

answered 28 Nov '16, 01:24

nevw's gravatar image

nevw
9.8k2690178
accept rate: 9%

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
×147

question asked: 27 Nov '16, 22:05

question was seen: 3,898 times

last updated: 28 Nov '16, 10:42

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