#9605 closed defect (fixed)
[patch] Align Nodes in Line moves outer node instead of middle one
Reported by: | dforsi | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.03 |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description
The attached .osm file contains a way with 3 nodes, no matter in which order I select them, when I use the "L" tool, the topmost node (id 2373880100) gets moved and aligned with the other two, creating what seems to be a self-intersecting way, while I would expect that the middle node (id 2556897398) gets moved; expected behaviour happens if I move the nodes around.
I tried with version 6502 (tested) and 6750 (latest).
Attachments (5)
Change History (17)
Changed 10 years ago by
Attachment: | linearize.osm added |
---|
comment:1 Changed 10 years ago by
Milestone: | → 14.02 |
---|
comment:2 Changed 10 years ago by
From source:trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java:
// Find from the selected nodes two that are the furthest apart.
So code-wise this behaviour is intended. Not sure whether that is very useful or not …
comment:3 Changed 10 years ago by
In my opinion it isn't useful if you have 3 consecutive nodes belonging to the same way (like in the file that I attached in the first comment) because the anchors are by definition the nodes at the extremities, because if you choose the middle node as an anchor then you get a self overlapping way.
Not sure how it extends to more complex situations, but it seems to me that no matter how many nodes are selected, if they belong to the same way it is desiderable that their new coordinates are related to the order in which the nodes appear in the way.
comment:4 Changed 10 years ago by
Milestone: | 14.02 → 14.03 |
---|
did not have enough time to work on this one.
comment:5 Changed 10 years ago by
Summary: | Align Nodes in Line moves outer node instead of middle one → [patch] Align Nodes in Line moves outer node instead of middle one |
---|
Changed 9 years ago by
Attachment: | test_case_9605_2.osm added |
---|
Changed 9 years ago by
Attachment: | bug9605_2.patch added |
---|
Changed 9 years ago by
Attachment: | AlignInLineActionTest.java added |
---|
comment:8 follow-up: 10 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This patch causes a regression when aligning nodes on closed ways (I tested on version latest).
I attached test_case_9605_2.osm to reproduce: select nodes ABD and align. I would expect that node A be centered between B and D. Instead node B is moved away.
Here is the patch: bug9605_2.patch and some non-regression tests: AlignInLineActionTest.java (maybe the setUp() method needs some adjustments as I had difficulties with launching it as a single unit-test in Eclipse).
comment:10 Changed 9 years ago by
Replying to oligo:
Here is the patch: bug9605_2.patch and some non-regression tests: AlignInLineActionTest.java (maybe the setUp() method needs some adjustments as I had difficulties with launching it as a single unit-test in Eclipse).
test case for bug #9605