[josm-dev] PATCH: Merge nodes

matthew-osm at newtoncomputing.co.uk matthew-osm at newtoncomputing.co.uk
Tue Oct 23 01:23:43 BST 2007


Hi,

Another JOSM patch while I'm hacking around at it.

Since moving to the new API I have lots of landuse= tags
that sit right next to roads. I want to now use the road as
the edge of the landuse area, but deleting and recreating
parts of the area to join them up is tedious at best.

This patch gives a Merge Nodes functionality - select two or
more nodes and they are "merged" together, i.e. all ways
that use those nodes are readjusted to use just one of them,
and the other nodes are deleted.

The only problem at the moment is you can't choose which
node to merge to, as the selection list is not in the order
of selecting the items (I was going to have it as "select
final node to leave first", but that doesn't work). Another
idea I had was to drag one node on top of another (probably
while holding a modifier key - ctrl?) - don't know how hard
it would be to implement that?

The code is based on the Combine Ways functinality - I
especially admit to not completely understanding the
relations code (I haven't worked out what relations are yet
;-) ), but hopefully it should all be OK. Someone please run
a quick eye over it for my sanity, before possibly applying
it.

  http://dl.newtoncomputing.co.uk/merge-nodes.patch

It does some sane things, such as always keeping a node that
has been uploaded (rather than deleting all uploaded nodes
and adding a new one). It will also do non-sane things such
as making a way turn back on itself, but you can do this
yourself anyway if you are so inclined ;-) (it won't create
a way like A-B-B-C; this is sanitised to A-B-C).

Thanks,

-- 
Matthew





More information about the josm-dev mailing list