Manually undelete node

From OpenStreetMap Wiki
(Redirected from Undelete node)
Jump to navigation Jump to search

The following describes a method to manually undelete a node by constructing an XML file which represents an undeletion. This method is rather fiddly and technical, and is no longer necessary. These days there are several better approaches and tools.

See Undoing deletions for better approaches

The process here is to modify the deletion flag (visible=) in the node XML, and then reupload using JOSM.

Get the deleted node data

First you will need to find the id of a deleted node (several ways to do this)

Next view the node in question. For node 502375284, this is:

Download the XML snippet using the Download XML hyperlink at the bottom of the page. Name it with .osm extension (e.g. undelete.osm). For the above example, the Download XML link is:

Modify the visible attribute

Open this file with a text editor.

Delete the first (older) entries, so that the XML contains just the most recent (deleted) <node> found on the server:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="JOSM">
   <node id="502375284" lat="52.9692276" lon="-1.1704875" user="sladen" uid="12671"
       visible="false" timestamp="2009-12-20T19:00:43Z" version="2">
     <tag k="naptan:NaptanCode" v="ntmamjdw"/>
     <tag k="name" v="Radford Road"/>
     ...
   </node>
</osm>

Change the visible= (deletion status) attribute and add the action= attribute to ensure upload processing. (Do not increment the version= number; the number must match the version already on the server.)

<osm version="0.6" generator="By Hand!">
  <node id="502375284" lat="52.9692276" lon="-1.1704875" user="sladen" uid="12671"
      visible="true" timestamp="2009-12-20T19:00:43Z"  version="2" action="modify">
    ...
  </node>
</osm>

Upload the change

Save and then open this .osm file in JOSM. Click upload and give a sensible edit summary. Hopefully it all worked and the node has been restored; check the history on the server again for comfort:

http://www.openstreetmap.org/browse/node/502375284/history