JA:Undoing deletions

From OpenStreetMap Wiki
Jump to navigation Jump to search

two merging arrows

このページまたは節を「Change rollback」と統合することが提案されています。(議論)

この記事は削除の取り消し(undoing deletions)について説明します。一般的な巻き戻しについてはChange rollbackを参照してください。

他のユーザーによる編集の取り消しの前に、まずは彼らに連絡をとることを試みてください。

編集中の削除の取り消し

一般的に、(JOSM、PotlatchまたはMerkaartorでは)Ctrl+Zを押すことで大体の意図しない編集ミスは取り消すことができます。多くの経験豊富なOpenStreetMapのコントリビューターでさえも「頻繁に」使います。

しかし、アップロードしてしまったらどうなるのでしょうか?

アップロード後の削除の取り消し

つまり、地図の多くを削除し、その後誤ってアップロードしてしまったのですか?!データをサーバに再び戻すにはどうすればいいのでしょうか?

方法 1: JOSMのUndeleteプラグインを使う

JOSM/Plugins/Undeleteを参照してください(あるいは、より一般的には JA:JOSM/Plugins/Reverter)。

方法 2: Level0で単一のノードの削除を取り消す

1つのノードの削除を取り消すために低レベルのエディターLevel0を使うことができます: JA:Level0#Undelete a nodeを参照してください。

方法 3: restore-version.py(コマンドライン)を使う

このGitHubリポジトリの指示にしたがってください。例: restore-version.py w12345 -1 のように実行できます。ここで、最初の引数はタイプとIDのオブジェクトです(ノードは n123、ウェイは w123、リレーションは r123 のように)。あるいは、単純にosm.orgからURLを渡すこともできます。

方法 4: 削除前に保存したコピーがある

この方法はあなたがJOSMを使っており、かつローカルマシンに保存されたデータのコピーを持っていることを仮定しています (ここではデータを "data.osm" としましょう)。data.osmをいつ保存したかが重要です。もしdata.osmが、あなたがアイテムを消す前のデータだったなら、容易に復元できるでしょう。たとえアイテムを消した後のデータであっても、アップロードする前であればまだ復元は可能です。アップロードした後のデータのコピーしか持っていない場合は、この方法を使って復元することはできません。

There is an important lesson here: as with any computer application, save locally as you go along, as well as uploading to the central server.

This should be fairly straightforward to recover. We want to tell the server that the items IDs that have been deleted are now modified. This will undelete them on the server.

  1. Start JOSM and download the affected area from the server. You can do this in small areas if you like.
  2. Load your "data.osm" from the local disk. Hopefully you will now see all data back again.
  3. Try and upload. Nothing should be available for upload, but if it is you will need to work out what it is and whether you really want to upload it.
  4. Use the select tool to select the area that was affected.
  5. Add a new tag to all this data, that does not clash with any existing tags. Maybe something like "ignore=me".
  6. Delete this new tag. All items you added this tag to are now marked as "modified" in JOSM, and are candidates for upload.
  7. Upload the data.
  8. Restart JOSM and download the affected area to check it has uploaded correctly.
  9. Repeat from 1 for any additional areas that need to be corrected.

Warning: this will set the items that you upload to the server to be the same as you have on disk. If your local copy is quite old, then by doing this you may revert changes that other people had made to the data on the server. This is another reason to keep saving locally as you are editing!

ツールの支援を受けない手作業の復元

削除されたリレーションの復元

For this example I'm using the relation 49903 for which I did a restore.

  1. Open the history in the browser: https://www.openstreetmap.org/browse/relation/49903/history
    1. if the relation does have a lot of versions step 1. may fail with an error message like (sorry, it take too much time...). You can directly open a specific version by using https://api.openstreetmap.org/api/0.6/relation/<Relation ID>/<Version number>
  2. Check that all ways of the relation still exist. If some of the ways are also deleted it's best to recover these first. Please be extra careful with this step. Had the ways been deleted for a good reason? Do more accurate ways exist? If so it might be a good Idea to use these in the recovered version instead. In my example this is the case.
  3. Download the XML source using the api url and save with .osm extension
  4. Open the file in a text editor. In my case the delete was in version 18, I want to recover version 17. I delete all old relation blocks, keep only version 17 and 18.
  5. Replace the line with the relation tag of the version you want to keep with the most current one. Don't forget to remove the closing slash in case the last version was a delete.
  6. Add the attribute action="modify" to the relation
  7. As in my case some ways need to be replaced - so I also removed these entries (it's easier to do this after opening in JOSM)
  8. Save the file and open it in JOSM
  9. If possible, download all members, run update data (CTRL+U) to check for any conflicts and deleted ways
  10. Upload your change in JOSM. Voilà, the relation is back.
  11. In my case I now downloaded the relation members and selected new ways to fill the gaps the previously deleted ways had left.

削除されたノードの復元

See Manually undelete node

削除された要素の元のリレーションメンバーを見つける

If you simply restore a deleted element, this will not restore the element's membership in any relations that it may have been a member of. If you're restoring something that was deleted, you definitely want to review its former relation membership and you may want to restore this as well.

Unfortunately, just looking at the history of a single element is not enough to find the relations it may have been a member of. But there are some methods to find this information.

方法 1: OSMChaを使う

  1. Open the changeset where the element was deleted in OSMCha.
  2. Go to the Other Features (+) tab.
  3. Expand the Deleted category.
  4. Review each of the relations in this category to see if they had the deleted element as a member. (It may be easier to review relation member changes by looking at the Deep History of the relations.)

方法 2: Overpassを使う

An Overpass query like this one can find the relations that an element was a member of at a given point in time.

[date:"2023-09-01T00:00:00Z"]; way(22386599); <; out tags;

  1. Use a date that is just before the changeset where the element was deleted.
  2. Use node(...), way(...), or relation(...) with the ID of the element that was deleted.
  3. Use an Overpass server with full Attic data (the default settings in Overpass Turbo are typically fine).
  4. View the results as Data, not as a Map (or use out geom; instead if you prefer to see the relations on a map).

他の人々によるアップロードの取り消し

Now what if somebody else deleted your edits and you have no way of finding exactly which way/node/relation was deleted? Then you need to find that in the history. See Find the id of a deleted node