#7889 closed defect (fixed)
Error making a way rectangular while two nodes should keep their positions
Reported by: | anonymous | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Select way (4 nodes) and 2 nodes of this way
- Press q
What happens instead?
Error display pops up.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2012-07-21 01:31:11 Last Changed Author: akks Revision: 5355 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2012-07-20 18:48:22 +0200 (Fri, 20 Jul 2012) Last Changed Rev: 5355 Identification: JOSM/1.5 (5355 de) Memory Usage: 568 MB / 3022 MB (256 MB allocated, but free) Java version: 1.6.0_18, Sun Microsystems Inc., OpenJDK 64-Bit Server VM Operating system: Linux Dataset consistency test: No problems found Plugin: PicLayer (27883) Plugin: alignways (28412) Plugin: graphview (28412) Plugin: licensechange (28412) Plugin: mapdust (28412) Plugin: mirrored_download (28418) Plugin: openstreetbugs (28412) Plugin: reverter (28412) Plugin: turnrestrictions (28412) Plugin: undelete (28416) Plugin: utilsplugin2 (28412) java.lang.AssertionError at org.openstreetmap.josm.actions.OrthogonalizeAction.orthogonalize(OrthogonalizeAction.java:383) at org.openstreetmap.josm.actions.OrthogonalizeAction.actionPerformed(OrthogonalizeAction.java:161) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1664) at javax.swing.JComponent.processKeyBinding(JComponent.java:2851) at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:285) at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:247) at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2928) at javax.swing.JComponent.processKeyBindings(JComponent.java:2920) at javax.swing.JComponent.processKeyEvent(JComponent.java:2814) at java.awt.Component.processEvent(Component.java:5913) at java.awt.Container.processEvent(Container.java:2105) at java.awt.Component.dispatchEventImpl(Component.java:4497) at java.awt.Container.dispatchEventImpl(Container.java:2163) at java.awt.Component.dispatchEvent(Component.java:4323) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1860) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:749) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1025) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:892) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:713) at java.awt.Component.dispatchEventImpl(Component.java:4367) at java.awt.Container.dispatchEventImpl(Container.java:2163) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4323) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:649) at java.awt.EventQueue.access$000(EventQueue.java:96) at java.awt.EventQueue$1.run(EventQueue.java:608) at java.awt.EventQueue$1.run(EventQueue.java:606) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116) at java.awt.EventQueue$2.run(EventQueue.java:622) at java.awt.EventQueue$2.run(EventQueue.java:620) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105) at java.awt.EventQueue.dispatchEvent(EventQueue.java:619) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177) at java.awt.EventDispatchThread.run(EventDispatchThread.java:138
Attachments (2)
Change History (8)
by , 12 years ago
comment:1 by , 12 years ago
I can confirm the bug in latest r5494.
The problem only occurs when you select the closed way and the both nodes, which are also in the second way. You can simplify the test case by deleting the second line. I will add a simplified version of the test case: select way and node "N1" and "N2".
"Orthogonalize Shape" without the two selected nodes results in the test case in an overlapping way. When you additionally select two nodes, the result will be adjusted to these nodes (the selected nodes will keep their positions).
It looks like the nodes will be rotated twice in this case. First they are rotate around a calculated centroid to make all ways orthogonal. Then from line 371 in OrthogonalizeAction.java the is some strange code: Now the nodes are rotated back and all nodes in headingNodes will be checked that they don't change their positions after all. But normally all ways will potentially change their length during orthogonalize() operation. So it is impossible to keep more than one node at the same position (but headingNodes contains the two selected nodes). For not failing all the time, there is a "magic" test that the position of the nodes in headingNodes don't change "too much". Even if the test don't fail, the result will not be really orthogonal, because the tiny changes of the headingNodes will not be stored.
To fix this, the nodes in headingNodes should never be moved.
comment:2 by , 12 years ago
Summary: | Make way rectangular → Error making a way rectangular while two nodes should keep theit positions |
---|
comment:3 by , 12 years ago
Summary: | Error making a way rectangular while two nodes should keep theit positions → Error making a way rectangular while two nodes should keep their positions |
---|
test case