Opened 11 years ago

Closed 10 years ago

#1419 closed defect (fixed)

Split Road does not always work

Reported by: LonelyPixel Owned by: cbro@…
Priority: major Milestone:
Component: merkaartor Version:
Keywords: Cc:

Description

I want to cut a street at a certain point but the option "cut street" (not sure how it's named in English) is disabled. The point is this:

<node id="31166381" lat="49.54036893" lon="11.15732222">

The road to cut is this:

<way id="4839182">

The option has worked with other roads, but not so this time.

OS: Windows XP, Version: Merkaartor 0.12

Attachments (2)

code.diff (3.9 KB) - added by LonelyPixel 10 years ago.
Patch of my proposed implementation
split-roads-demo.mdc (33.9 KB) - added by LonelyPixel 10 years ago.
Small test set of connected roads to try out the altered behaviour. (Zoom in a little to see all roads.)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by dantje

This is because the node is part of two roads and the code currently is not clever enough to understand what should be the obvious action. Actually the menu action "split" is inactive in this case, but the keyboard shortcut is not complaining or doing anything.

Workaround: Select the road you are trying to split, then hold CTRL and select the node at which the road should be broken up. Then try to split again.

comment:2 Changed 10 years ago by LonelyPixel

Resolution: invalid
Status: newclosed

comment:3 Changed 10 years ago by LonelyPixel

Resolution: invalid
Status: closedreopened
Summary: Cutting a street does not always workSplit Road does not always work

Closed my ticket in mistake...

This patch improves the situation about splitting roads with only a node selected but no road.

Currently the Split Road command works with only a node selected if the node is only part of a single road. If a node is part of two roads, once in the middle of the road and once at the end of a road (the node that connects the end of one road to the middle of another road - a road junction node), it cannot determine the road to split, although it's obvious.

This patch adds code to determine whether a node is the first or last node of a road. This new test is used to determine whether a node is part of a single road where it's not at the end. As a side effect, this also disables the Split Road command if a single node at the end of a road is selected, in which situation splitting doesn't make sense anyway. I also found duplicate code to determine the node-on-single-road situation and eliminated it by calling the other function.

To not confuse existing code, I have added separate functions that do the "inner" check. Some of the previous functions/variables are not used anymore for now. I have left them in the code in case somebody wants to use them or for possible future extensions.

Changed 10 years ago by LonelyPixel

Attachment: code.diff added

Patch of my proposed implementation

Changed 10 years ago by LonelyPixel

Attachment: split-roads-demo.mdc added

Small test set of connected roads to try out the altered behaviour. (Zoom in a little to see all roads.)

comment:4 Changed 10 years ago by Chris Browet

Resolution: fixed
Status: reopenedclosed

(In [13205]) ADD : Single-node splitting of roads even with a connection to the extremity of another road (by Yves Goergen) (closes #1419)

Note: See TracTickets for help on using tickets.