Modify

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#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?

  1. Select way (4 nodes) and 2 nodes of this way
  2. 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)

test.osm (1012 bytes ) - added by anonymous 12 years ago.
test case
simplified_test.osm (722 bytes ) - added by mdk 12 years ago.
simplified test case

Download all attachments as: .zip

Change History (8)

by anonymous, 12 years ago

Attachment: test.osm added

test case

comment:1 by mdk, 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.

Version 1, edited 12 years ago by mdk (previous) (next) (diff)

by mdk, 12 years ago

Attachment: simplified_test.osm added

simplified test case

comment:2 by mdk, 12 years ago

Summary: Make way rectangularError making a way rectangular while two nodes should keep theit positions

comment:3 by rickmastfan67, 12 years ago

Summary: Error making a way rectangular while two nodes should keep theit positionsError making a way rectangular while two nodes should keep their positions

comment:4 by rickmastfan67, 12 years ago

I can verify this as well using Windows 7 x64 and r5494.

Last edited 12 years ago by rickmastfan67 (previous) (diff)

comment:5 by bastiK, 12 years ago

Resolution: fixed
Status: newclosed

In 5686/josm:

fixed #7889 - Error making a way rectangular while two nodes should keep their positions

comment:6 by Don-vip, 11 years ago

Ticket #5803 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.