Hi,
I try to find deleted or changed objects (nodes, ways and relations) e.g. deleted amenity=restaurant or changed amenity=restaurant to shop, cafe or post office after 2018.(query with {{bbox}}
).
I tried different queries but with no results.
Could you post a link to an example query?
I tried this query, but it finds all restaurants. I try to find restaurants, that are deleted or are no longer with tag amenity=restaurant.
[out:json][timeout:200];
retro ('2018-01-01T00:00:00Z') {
// gather results
(
nwr["amenity"="restaurant"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
}
There is this old discussion:
In that discussion @SomeoneElse linked to this overpass query:
Probably not exactly what you are looking for but maybe it helps.
Like the example above, that is just “show me what things were like on a date in the past”, not also checking that they have since been deleted. I’m sure some Overpass wizard will be along shortly to help with that bit
The longer the time range, the longer the result will take.
This query will return all modified and deleted amenity=restaurant objects. You need to look in the text box and filter out the deleted ones. I’m looking for the correct query, if it exists, for elements (id) that have changed key=value.
[adiff:"2025-01-01T00:00:00Z","2023-01-01T00:00:00Z"]; nwr["amenity"="restaurant"]({{bbox}}); compare(delta:1); out geom meta;
I noticed that this query does not find objects created and deleted between two timestamps.
This query will find objects which existed at one time stamp and don’t exist at a later timestamp, right?
I assume it will not report objects which were created and deleted / changed between those two timestamps.
Yes, you are right. Now I noticed that it does not find objects created and deleted between two dates.
Try to see overpassQL
https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL
Upps, a small mistake in the order of the dates, sorry, I was doing trial and error and I mixed up the text on my clipboard.
The query has the date ranges in reverse order, OverPass cannot interpret the date range and uses the most recent one or the first.
Only 2 numbers need to be changed.
[adiff:"2023-01-01T00:00:00Z","2025-01-01T00:00:00Z"]; nwr["amenity"="restaurant"]({{bbox}}); compare(delta:1); out geom meta;
The following is the tutorial I use for various complex queries that I don’t find in the OverPass API.
https://dev.overpass-api.de/overpass-doc/en/analysis/museum.html