JOSM hacking: Upgrading nodes to ways with Replace Geometry
Posted by JoshD on 22 January 2012 in English.For anyone who's used JOSM for a significant amount of time, it's likely they've been using utilsplugin2, which provides several useful functions. One of these is Replace Geometry, which replaces an existing but poor quality way with a freshly drawn one, preserving history in the process by transferring existing nodes to the new way. The usefulness of this function has somewhat lessened thanks to the ImproveWayAccuracy plugin, but I still find myself using it often.
I've recently enhanced this command to support replacing a node with a way (see this ticket for details). This is very useful and timesaving in a number of cases. One is if you come across features that are represented by both a node and a way (a violation of the one feature one object rule). Another is if you wish to upgrade a feature that exists as a node, such as by drawing the building outline of a restaurant. In either case, simply select the node and way, then run the command, which will transfer tags from the node to the way, and either delete or move the node, whichever allows keeping the most history.
Before, but especially after adding this functionality, I've seen the need to prompt the user to resolve tag conflicts like the Merge nodes tool rather than just blindly copying the tags. Please read this ticket and comment if you think this is a good idea. Also, I've seen some other situations which might lead to information loss or corrupt data. Please read and comment on this ticket.
If you'd like to try this new functionality, just update your plugins in the preferences dialog!
Discussion