I want to use a JOSM overpass query to exclude from a "building=" download all buildings that have an "entrance=" node that has "addr:housenumber" or "addr:street".

.

asked 14 May, 12:33

Alan01730's gravatar image

Alan01730
314283245
accept rate: 0%


Here's a basic sketch of how to do it:

[bbox:{{bbox}}];
// find buildings
way[building]->.buildings;
// nodes that are part of a building that also have an entrance tag
node(w.buildings)[entrance]->.entrances;
// buildings that have entrances
way(bn.entrances)[building]->.entranced;
// the difference between the sets
(.buildings; - .entranced;);
out geom;

You can see that the Walmart in the bounding box is not in the result set, as it does have an entrance. You'll need to add some rules to deal with the requirement for an address component and you might want to handle relations in addition to ways, but the basic pattern is to find the buildings, use the node recursion filter to find the entrances, use the way (and maybe relation) recursion filters to find the buildings those nodes are members of, and then take the difference between that and the initial set of buildings.

permanent link

answered 15 May, 02:35

maxerickson's gravatar image

maxerickson
11.0k1075155
accept rate: 30%

Thanks @maxerickson that's a great answer, especially with the sample code. You are a good teacher. I always knew I'd have to learn more than just the "Wizard"

(15 May, 21:38) Alan01730
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:

×521
×355

question asked: 14 May, 12:33

question was seen: 302 times

last updated: 15 May, 21:38

powered by OSQA