Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6243 closed defect (duplicate)

operation producing dublicate nodes in ways

Reported by: mdk Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: dublicate node Cc:

Description

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
  1. way: the same way where node '1' and '2' are merged (select '2', SHIFT-Select '1', press 'M') this way still has 5 nodes.
  1. 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.
  1. 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);
  } 
}


Attachments (1)

dublicate nodes in way.osm (2.7 KB ) - added by mdk 14 years ago.

Download all attachments as: .zip

Change History (4)

by mdk, 14 years ago

Attachment: dublicate nodes in way.osm added

comment:1 by Zverikk, 14 years ago

This was probably fixed in [4053]. Please try this with the latest version of JOSM.

comment:2 by stoecker, 14 years ago

Resolution: duplicate
Status: newclosed

comment:3 by stoecker, 14 years ago

Closed as duplicate of #6219.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.