﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6243	operation producing dublicate nodes in ways	mdk	team	"I use JOSM 4021, but the problem exists much longer.

I attached an osm file to see the necessary operations. Use the validator to see the problem.

1. way: a normal way with 5 nodes

2. way: the same way where node '1' and '2' are merged (select '2', SHIFT-Select '1', press 'M') this way still has 5 nodes.

3. way: deleteion of node '3'. The result has now 4 nodes containing the merged node '1;2' twice. This may be one reason for the ""dublicate node in way"" errors.

4. way: starting from way 2 and merging '3' with '1;2'. This time we don't have a dublicate node error and the way has only 3 nodes.

To avoid the dublicate node errors there is a simple check to be done on deleting a node (pseudo code):


{{{
delete(a: Node) {
  for each way w containing a do {
    int i = w.Index(a);
    if w.Node(i-1) = w.Node(i+1) {
      // the node before and after a are the same, so we can remove one of them
      w.removeNode(w.Node(i+1));
    }
    // remove node a from the way
    w.removeNode(a);
  } 
}
}}}
 "	defect	closed	normal		Core	tested	duplicate	dublicate node	
