Find the id of a deleted node
There are several ways to find the id of a deleted node. This may be needed for some approaches to undoing deletions.
Deleted nodes remain in the database forever with unchanged id, but with
visible=false instead of
visible=true. There are several ways to find the id of a deleted node – based on an explanation by Frederik Ramm on the talk-de mailinglist:
Find the changeset method
If you can find a changeset which created, deleted or edited the node in some way, then browsing within said changeset can reveal the node id. Note that Achavi (graphical tool) often can be very helpful for finding the exact node.
There are several ways of finding the changeset:
- Use WhoDidIt (OpenStreetMap Changeset Analyzer) and browse to the location to get a list of changesets with local changes. Each changeset is summarized with the number of added (green), modified (yellow) and deleted (red) nodes, ways and relations. If there are not too many changesets, it might be possible to find it.
- Use OSMCHA and set the bbox (bounding box) of the filter to cover a small area around the deleted node to find any changesets that may have touched it. Works up to a month back.
- If you know a user who created, deleted or edited the node, go to their user profile on the website and browse their edits to find the changeset. It may help if you know when they did it.
- The extended API allow you to query user edits in a specific period, between other options. For example:
Overpass API method
Use the Overpass changed filter to find all nodes in a bounding box that have changed/been deleted since a given date. This can be filtered by tags. Appears to be a memory intensive operation, so may not work for all. As an alternative use the date setting to retrieve all data in a bounding box at a certain point of time (up to September 2012) and check if the object existed back then.
You can also use the retro statement to find objects that existed at a previous point in time.
Potlatch 1 method
If your node is part of a deleted way, then you can use the old editor Potlatch 1 to find the deleted way (see Change rollback#Potlatch 1).
Old planet file method
If the node was deleted less than 6 months ago, an old GeoFabrik OSM Data Extract is probably available to download, and this will contain the deleted data. Download the right .osm.bz2 file. Alternatively OSM developers may have an older planet file if you ask around.
Even an extract is probably huge. In that case, consider using osmosis to cut out a smaller area around the node. Once you have a small uncompressed .osm file you can open this in a text editor and search for the node, or open the small area in JOSM.
Full history file method
If none of the above works, try to find a full history dump (see Planet.osm/full) including the area of interest. Unlike the GeoFabrik extracts, a full history dump also contains deleted/invisible nodes. Use the osm-history-splitter to cut out the smallest possible area.