Opened 14 years ago

Last modified 7 years ago

#5133 closed enhancement

remove node from way — at Version 8

Reported by: Oli-Wan Owned by: team
Priority: normal Milestone: 13.11
Component: Core Version:
Keywords: Cc:

Description (last modified by skyper)

I'd like an entry in the tools menu to remove one node from a way: keep both the way and the node with all their respective properties and relation memberships, but have the node no longer be part of the way.

This boils down to deleting a single "<nd ref=...>" line, but (as far as I know) cannot be done in JOSM directly. Instead, you have to duplicate the node, manually edit the new node's relation memberships, then delete the old node, which ist needlessly cumbersome for such a trivial task.

Change History (9)

comment:1 by stoecker, 14 years ago

Resolution: worksforme
Status: newclosed

I think this is already implemented. Select node and choose the unglue tool ('G').

in reply to:  1 comment:2 by Oli-Wan, 14 years ago

Resolution: worksforme
Status: closedreopened

Replying to stoecker:

I think this is already implemented. Select node and choose the unglue tool ('G').

Thanks for the hint, but unfortunately, unglue does not do the job. There is in fact a workaround (see below), but I think this is still too complicated.

What unglue does is the following: Suppose you have two ways sharing a common node; then moving the node will affect both ways. Unglue-ing duplicates the node, such that the one way contains the original node, the other contains the duplicate. You can now move around both ways independently. (Works analogously for more than two ways sharing one common node.)

To elaborate on my request: Imagine a single way consisting of n>=3 points. (The n=3 case is actually trivial.) Now suppose you want to take one of the points out of the way, such that you stick with a way consisting of n-1 points and a single point.

You need to do that whenever you come across some POI which someone has accidentally made part of a way -- or maybe on purpose, in a place where this is not [any longer] sensible. For the latter case, take a bus stop which has been relocated to a different street or bus lane or whatever, while the name and all of its route relation memberships remain as before.

Suppose you have points A,B,C along some way, and you want to take out B. The workaround is:

  1. split (P) the way three times - at A,B,C
  2. delete the ways connecting A to B and B to C
  3. extend the remaining way ending in A to C (or vice versa)
  4. then combine (C) the two ways meeting up at C

This involves at least ten clicks or keystrokes (seven plus a rectangle selection, if you are lucky), while it could be done in just two (or three, via the menu).

comment:3 by stoecker, 14 years ago

Please try what I wrote:

  • select the node (nothing else)
  • unglue

You get this node unglued and a new node entered in way. This node can then be removed.

Probably the node needs to have tags for this to work.

comment:4 by Oli-Wan, 14 years ago

Okay, well thanks.

I did try your suggestion in the first place, but that just produced an error message.

However, you are perfectly right: if (and only if) the node has some tag, it works. I just opened a josm window and tried the trick whatever ways I found.

I do not know whether the dependency on a tag is a bug or a feature. Anyway, I think it would be a good idea to make the error message somewhat more explicit.
Currently, it displays only "This node is not glued to anything else", which suggests that unglue can only be applied to a shared node, and gives no hint about the "one-point use" of unglue.

What is the JOSM policy on error messages? Keep them as short as possible, and put all advanced information in the documentation? Or is there room for adding something like "Did you try to...?", separated by two newlines? I think that would be very helpful here.

Thanks again.

comment:5 by Oli-Wan, 14 years ago

On second thought, whoever tries the feature, will try it on a tagged point. So the issue probably almost never arises...

comment:6 by stanton, 13 years ago

I just came across the same need: to detach a node from a way.

Extra thought: often I come across a node that is in the middle of a way, has some tags attached and is possibly a member of some relations. I would like to move that node to the side of the way but also keep a node in the way (because the node may not be in line with its neighbors, or it may be the last node in the way, and removing it would change the shape of the way when all that was intended was to move the tags and relation memberships somewhere else).

Suggestion: I would like a command that does the following:

  • Create a new node at the same position as the selected one
  • Remove the selected node from all ways that use it
  • Insert the new node into all these ways in the same position as the selected node

Maybe we can present the user with a choice ("Do you want to insert a blank node in the same position?") and if the user chooses not to, omit the first two steps.

I think it's important to keep the tags on the old node (and insert a fresh node in the way, rather than moving the data to a new node and keeping the old one in the way) in order to preserve the history of the old node (the history of a tag-less node in a way is probably less important than that of a node with tags and relation memberships).

Last edited 13 years ago by stanton (previous) (diff)

comment:7 by stanton, 13 years ago

I've tried Unglue on a few occasions and found that it messes up relations:

  • The node on the way maintains its position in all relations it is a member of.
  • The detached node is inserted into each of these, but at the very end.

When I take a tram stop (which is a node on the way) and unglue it so that I can move it e.g. to the other side of a crossing, this behavior messes up the order of stops in my relations (the order matters for some renderers).

Suggestions:

  • Insert the new node into relations either before or behind the existing one, but not at the end. (Oh yes, if the existing node is a member in multiple positions of that relation, add the new one next to each occurrence of the old one).
  • Present the user with a choice (similar to the one when merging two ways) listing all relations which contain the unglued node and a drop-down box for selecting which nodes to keep (choices: Keep node on the way, Keep unglued node, Keep both, Remove both)

in reply to:  7 comment:8 by skyper, 11 years ago

Description: modified (diff)

Replying to stanton:

I've tried Unglue on a few occasions and found that it messes up relations:

  • The node on the way maintains its position in all relations it is a member of.
  • The detached node is inserted into each of these, but at the very end.

When I take a tram stop (which is a node on the way) and unglue it so that I can move it e.g. to the other side of a crossing, this behavior messes up the order of stops in my relations (the order matters for some renderers).

Suggestions:

  • Insert the new node into relations either before or behind the existing one, but not at the end. (Oh yes, if the existing node is a member in multiple positions of that relation, add the new one next to each occurrence of the old one).
  • Present the user with a choice (similar to the one when merging two ways) listing all relations which contain the unglued node and a drop-down box for selecting which nodes to keep (choices: Keep node on the way, Keep unglued node, Keep both, Remove both)

You are right this should be fixed.

Is the original issue still a problem ?

by giuseppe.bilotta@…, 11 years ago

Patch to implement the feature

Note: See TracTickets for help on using tickets.