I am trying to select and export to GeoJSON all buildings that are located in certain area (city district). The Overpass API Query I am trying to use (in Overpass Turbo Interface) is below:
[out:json];
area[name="Berlin"]->.b;
rel(area.b)[name="Tiergarten"];
map_to_area -> .a;
(
way["building"](area.a);
relation["building"](area.a);
);
// print results
out body;
>;
out skel qt;
The query like this is working, but I have an issue to solve.
I only want to select polygons (not POIs and not lines that have the tag "building"). This includes both polygons defined as ways and multipolygons defined as relations. But those multipolygon relations also include points and lines that I wish not to select (marked red in picture below)
How do I need to modify my query?
I tried to play with recursions, area sets and more closely defining tags, but without success. The reason to get "clean" selection like that is that I plan to use it repeatedly for some other cities and city districts.
I am fairly new to Overpass API.