JOSM - various matters, tips, shortcuts

G” - Unglue edges.
Q” - Orthogonize shape to make all angles 90 degreese for buildings.
Ctrl+Alt” - Scale shape (eg. reducing the shape of the building).
Shift+Ctrl” - Rotate shape.
Ctrl+selected node” - Move the node to another node and link them together.

Java script for JOSM Scripting Plugin - useful for mass manipulation of OSM tags - i write it for preparing village import for Nepal from OCHA shapefiles :


  //Mass tags rename in JOSM Scripting Plugin
  //DOC: http://gubaer.github.io/josm-scripting-plugin/doc/manipulating-data.html
	
    var command = require("josm/command");
    var layer = josm.layers.get(0);           //first layer in table of content
    var ds1 = layer.data;
    var villages = ds1.query("OCHA_PCODE=*");  //search for all objects with this tag 

    for(var i = 0; i < villages.length; i++) {
        josm.layers.activeLayer.apply(

           // NEW:               place:village           
                 command.change(villages[i], {tags: {"place": "village"}}),

           // NEW:               source:OCHA-ASIA           
                 command.change(villages[i], {tags: {"source": "OCHA-ASIA"}}),
			
           // CHANGE:        VIL_NAME > name
               command.change(villages[i], {tags: {"name": villages[i].get("VIL_NAME")}}),// rewrite value of old/existing tag to new
               command.change(villages[i], {tags: {"VIL_NAME": null}}) ,//setting to null = delete tag  

           // CHANGE:         ZONE > is_in:zone
               command.change(villages[i], {tags: {"is_in:zone": villages[i].get("ZONE")}}), 
               command.change(villages[i], {tags: {"ZONE": null}}),        

           // CHANGE:         DIST_NAME > is_in:district
               command.change(villages[i], {tags: {"is_in:district": villages[i].get("DIST_NAME")}}),
               command.change(villages[i], {tags: {"DIST_NAME": null}}) ,

            // CHANGE:        VDC_NAME > is_in:vdc
               command.change(villages[i], {tags: {"is_in:vdc": villages[i].get("VDC_NAME")}}),
               command.change(villages[i], {tags: {"VDC_NAME": null}}) ,

            // CHANGE:        OCHA_VNAME > unocha:vname
               command.change(villages[i], {tags: {"unocha:vname": villages[i].get("OCHA_VNAME")}}),
               command.change(villages[i], {tags: {"OCHA_VNAME": null}}),
			   
	   // CHANGE:        OCHA_PCODE > unocha:pcode
               command.change(villages[i], {tags: {"unocha:pcode": villages[i].get("OCHA_PCODE")}}),
               command.change(villages[i], {tags: {"OCHA_PCODE": null}}),

            // CHANGE:        VIL_CODDE > unocha:vil_code
               command.change(villages[i], {tags: {"unocha:vil_code": villages[i].get("VIL_CODDE")}}),
               command.change(villages[i], {tags: {"VIL_CODDE": null}}),
			   
	    // CHANGE:        HLCIT_CODE > hlcit:code
               command.change(villages[i], {tags: {"hlcit:code": villages[i].get("HLCIT_CODE")}}),
               command.change(villages[i], {tags: {"HLCIT_CODE": null}}),
			   
       	// DELETE rest
               command.change(villages[i], {tags: {"AREA": null}}),
			   command.change(villages[i], {tags: {"CBS_CODE": null}}),
			   command.change(villages[i], {tags: {"CONSTITUEN": null}}),
			   command.change(villages[i], {tags: {"DCODE": null}}),
			   command.change(villages[i], {tags: {"ILAKA": null}}),
			   command.change(villages[i], {tags: {"VCODE": null}}),
			   command.change(villages[i], {tags: {"VIL_NAME_": null}}),
			   command.change(villages[i], {tags: {"VIL_NAME_I": null}}),
			   command.change(villages[i], {tags: {"WNO": null}})
        );
    }
	josm.alert("Ready..");

Must be
Plugin JOSM/Plugins/BuildingsTools.
https://wiki.openstreetmap.org/wiki/JOSM/Plugins/BuildingsTools

Allows you to draw rectangular outlines for buildings.
Icon in the left menu or “B