A school will have a number of buildings and they will be located close by. I tried with overpass the query which can select only one of these buildings and skip the rest. But not Proper working. Can you tell me the query for that …
https://overpass-turbo.eu/s/ZEM
[out:json]
[timeout:25];
way({{bbox}})[amenity=school];
map_to_area ->.area;
(
(
node ["building"="school"]({{bbox}});
way ["building"="school"]({{bbox}});
)->.scl;
(
(
node ["building"="school"]["amenity"!~"."]({{bbox}});
way ["building"="school"]["amenity"!~"."]({{bbox}});
);
-
(
// All nodes+ways with building=school and no amenity=* tag in area
node ["building"="school"]["amenity"!~"."](area.area);
way ["building"="school"]["amenity"!~"."](area.area);
);)->.samp1;
(
node.samp1(around.scl:100);
way.samp1(around.scl:100);
)->.near;
(.samp1; - .near;);
);
out center;