An augmented diff shows deleted objects with their last version, so you can see what was there and restore it if it was deleted by mistake. compare(delta:id()) leaves out the objects that were only edited.
This query lists what disappeared around Paradeplatz in Zürich between 1 April and 1 July 2024.
The query
[out:xml][timeout:60][adiff:"2024-04-01T00:00:00Z","2024-07-01T00:00:00Z"]; nw(47.370,8.538,47.372,8.542)(if:count_tags()>0); compare(delta:id()); out meta geom;
Run it
Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL).
How it works
[adiff:…]compares the two dates. Only the augmented diff marks deleted objects;[diff:…]does not.(if:count_tags()>0)skips the untagged nodes of ways.compare(delta:id())keeps only the elements that are in one of the two answers: what was added and what is gone.- A deletion is an
<action type="delete">whose<new>version hasvisible="false", with the version, time and user of the deletion. Withoutvisible="false", the object still exists and no longer matches the query. - Here ten benches, two shops, an office, a footway and a building part were deleted. The answer also lists what was added in the same months.
Variations
- To restore a deleted object, take its tags and position from
<old>, or query it at a date before the deletion:[date:"2024-04-01T00:00:00Z"];node(7815426573);out meta;. - Edits too: leave out
compare(delta:id());, as in changes in an area. - Objects deleted before 12 September 2012 are not in the history.
Run it from your code
curl https://api.overpass.ch/v1/YOUR_API_KEY/interpreter \
--data-urlencode 'data@query.overpassql'
import requests
query = open("query.overpassql").read()
r = requests.post("https://api.overpass.ch/v1/YOUR_API_KEY/interpreter",
data={"data": query}, timeout=120)
r.raise_for_status()
print(r.text)
const res = await fetch("https://api.overpass.ch/v1/YOUR_API_KEY/interpreter", {
method: "POST",
body: new URLSearchParams({ data: query }),
});
if (!res.ok) throw new Error(await res.text());
console.log(await res.text());
Save the query as query.overpassql. It works the same in Overpass Turbo, QGIS and JOSM.