JOSM Scripting Plugin

Run scripts in the Open Street Map editor JOSM

The JOSM Scripting Plugin is a plugin for the Open Street Map editor JOSM.

It includes a built-in scripting engine for Javascript based on Mozilla Rhino and an API for Javascript to manipulate JOSMs internal application objects.

var command = require("josm/command");
var nodeBuilder = require("josm/builder").NodeBuilder; 
josm.layers.activeLayer.apply(
    command.add(
      nodeBuilder
        .withTags({amenity: "restaurant"})
        .withPosition(12.34,45.67)
        .create()
  )
);
josm.alert("Added a node");

It also executes Python scripts and can load and execute plugins written in Python.

In addition, it can execute scripts written in Groovy, Ruby, or any other language for which a JSR-223 compatible script engine is available.