Revert scripts

From OpenStreetMap Wiki
Jump to navigation Jump to search

The OSM revert scripts allow a power user (someone who knows what they are doing with these scripts) to perform change rollback. Unlike Bulk_upload.pl, the scripts don't use OSM Perl packages but rather regular expressions to do all parsing. These scripts, which were written by User:Frederik Ramm in Perl can be downloaded from github.

Act responsibly!

These scripts should only be used if you are confident that the change sets in question are damaging to OpenStreetMap. Prior to using this script do refer to the Automated edits and to the Automated Edits code of conduct. Make reasonably efforts to discuss the issue with the contributor beforehand and afterwards. Do remain civil and assume good faith. When in doubt, discuss things on an mailing list before you act.

These scripts do not have safety nets. Be sure that you feel confident to fix anything you might break. If you do not know your PUTs from your GETs, if you do not know the details of API 0.6, or don't know what changesets are and how they work, then DO NOT USE THIS SOFTWARE.

Package contents

  • changeset.pl / Changeset.pm -- opens and closes changesets
  • undo.pl / Undo.pm -- undoes one change to one object
  • undelete.pl / Undelete.pm -- undeletes an object; see comment in-file for differences to undo
  • revert.pl / Revert.pm -- reverts a whole changeset

Configuration

You will have to create a file in your home directory called .osmtoolsrc containing your user name, password, and the URL of the OSM dev server to use. (Check if you have an account on the dev server.) The URL must be complete up to the API version number and the slash afterwards, so:

username=fred
password=test
apiurl=http://api06.dev.openstreetmap.org/api/0.6/

By default, all tools will run in "dry run" mode, so no changes will be actually written and all write requests will be considered successful. Add the dryrun=0 parameter to the file for live action.

By default, "dry run" also enables "debug" so you are shown the requests made. If you want to keep debug mode when setting dryrun=0, explicitly set debug=1.

Please use some of the testing servers for the apiurl until you are quite confident working with those scripts. Note that you need to register separate account on each testing server.

Once you are confident you know what you're doing and that the scripts are performing as you want them to, you can change to production API URL (as found for example in JOSM preference "Base server URL" - add /0.6/ to the end of it, to specify API version to use)

Readme

The above text was sourced from the README file for the software. The scripts in this directory together form the "osmtools" suite. Originally written by User:Frederik Ramm, public domain. The scripts require Perl and the LWP module (libwww-perl on Ubuntu et al.).

External links