Hi. I am experiencing challenges querying buildings on a campus via overpass with
[out:json][timeout:30];
area[name='Cape Peninsula University of Technology (Bellville Campus)']->.a;
(
(
// I want all buildings
way[building](area.a);
// plus every building:part
way["building:part"](area.a);
// and multipolygon relation ¬ to represent buildings with courtyards correctly
relation["building"]["type"="multipolygon"](area.a);
);
-
// excluding buildings with relation type=building role=outline ¬ I want to correct form/height of the part
(
// for every way in the input set select the relations of which it is an "outline" member
rel(bw:"outline")["type"="building"];
// back to the ways with role "outline"
way(r:"outline");
);
);
out body;
>;
out skel qt;
three buildings are not being harvested correctly https://www.openstreetmap.org/relation/12469713, https://www.openstreetmap.org/relation/12442311 and https://www.openstreetmap.org/relation/12445158 are building:parts
with a courtyard (multipolygon relation role=inner
) that exist within an outline
type=building
relation which contain the same courtyard. (i.e.: the courtyard is inside a building:part
and the role=outer
is coming with the query even though I’ve excluded the outline
).
I want the form/shape and height of the building:part
and not the outline; while being mindful of every other structure on the campus. How do I exclude the relation type=multipolygon
role=outer
when type=building
role=outline
already exists for a structure? Have I created the relations incorrectly? Your help is appreciated.
asked
22 Mar '21, 07:24
arkriger
155●13●14●21
accept rate:
0%
It is now obvious the fault lies with how I tagged these features.
If we focus on Relation: 12469713 I don't know where the relation
type=building
role=outline goes
.I don't know.
building:part multipolygon
relations were not accounted for - when abuilding:part
has a courtyard.adding:
relation["building:part"]["type"="multipolygon"](area.a);
to the query (line 10) fixes it.