Overpass query example

Deleted objects in an area

Find what was deleted in an area between two dates, with its last version and who deleted it. Example: Paradeplatz, Zürich, April to June 2024.

History queries are part of the Medium and Large plans. The result below runs on our server for this page.

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

Running the query…

Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL).

How it works

  1. [adiff:…] compares the two dates. Only the augmented diff marks deleted objects; [diff:…] does not.
  2. (if:count_tags()>0) skips the untagged nodes of ways.
  3. compare(delta:id()) keeps only the elements that are in one of the two answers: what was added and what is gone.
  4. A deletion is an <action type="delete"> whose <new> version has visible="false", with the version, time and user of the deletion. Without visible="false", the object still exists and no longer matches the query.
  5. 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'

Save the query as query.overpassql. It works the same in Overpass Turbo, QGIS and JOSM.

More examples

All examples →