Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#6243 closed defect (duplicate)

operation producing dublicate nodes in ways

Reported by: mdk Owned by: team
Priority: normal 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 2 years ago.

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by mdk

comment:1 Changed 2 years ago by Zverikk

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

comment:2 Changed 2 years ago by stoecker

  • Resolution set to duplicate
  • Status changed from new to closed

comment:3 Changed 2 years ago by stoecker

Closed as duplicate of #6219.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.