Overpass 'buildings' without area

Hello.

I have an overpass call —all buildings— but it comes with area.b. The first feature is the actual area I’m focusing on.

[out:json][timeout:30];
// --when areas have duplicate names given the world has a limited amount of uniquely named places
(area[name='Western Cape'] ->.b;
    // -- target area ~ can be way or relation
    way(area.b)[name='Cape Peninsula University of Technology (Bellville Campus)'];
    map_to_area -> .a;
        // I want all buildings
        way['building'](area.a);
        // and relation type=multipolygon ~ to removed courtyards from buildings
        relation["building"]["type"="multipolygon"](area.a);
    );
out body;
>;
out skel qt;

How do I call for building but not return the actual area please?

Hi.
The outer round brackets define a union statement, that is all the inner queries will be in the output set . You should simply move the opening ( just before way[‘building’], so to exclude the campus polygon

[out:json][timeout:30];
// --when areas have duplicate names given the world has a limited amount of uniquely named places
area[name='Western Cape'] ->.b;
    // -- target area ~ can be way or relation
    way(area.b)[name='Cape Peninsula University of Technology (Bellville Campus)'];
    map_to_area -> .a;
        // I want all buildings
        (way['building'](area.a);
        // and relation type=multipolygon ~ to removed courtyards from buildings
        relation["building"]["type"="multipolygon"](area.a);
    );
out body;
>;
out skel qt;
2 Likes

Thank you @IlBano