[GIS] Exclude elements from overpass query

openstreetmapoverpass-api

I have a query in overpass turbo, which searches for all buildings in the current bounding box (http://overpass-turbo.eu/s/Dgv). I would like to exclude buildings with certain id's from the output – e.g. the house no. 14 in the center with OSM id=93778916.

Any ideas how to do that?

After reading some other posts I understand, that the Overpass QL "if:" statement might work. But I really have to clue how to use it.

Best Answer

In this case, I would use the difference statement and simply substract buildings with a given id. The following example excludes way ids 93778916 and 209000787.

[out:json][timeout:25];
(way[building=yes]({{bbox}}); 
 -
 way(id:93778916, 209000787);
);     
out body;
>;
out skel qt;
Related Question