Modify

Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#8768 closed defect (fixed)

plugin routing, create new routing layer fail

Reported by: anonymous Owned by: franpd
Priority: normal Milestone:
Component: Plugin routing Version:
Keywords: Cc:

Description (last modified by Don-vip)

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-06-05 01:34:49
Last Changed Author: Don-vip
Revision: 5990
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-06-05 00:52:58 +0200 (Wed, 05 Jun 2013)
Last Changed Rev: 5990

Identification: JOSM/1.5 (5990 en) Linux Ubuntu 12.04.2 LTS
Memory Usage: 559 MB / 883 MB (254 MB allocated, but free)
Java version: 1.6.0_27, Sun Microsystems Inc., OpenJDK Server VM
VM arguments: [-Djava.net.useSystemProxies=true]

Dataset consistency test:
[WARN - NO NODES] Way {Way id=219775407 version=1 V nodes=[{Node id=2289104233 version=1 V lat=40.2091388,lon=44.53027}]} has only one node


Plugin: ImportImagePlugin (29531)
Plugin: PicLayer (29601)
Plugin: buildings_tools (29596)
Plugin: geotools (29435)
Plugin: imagery_offset_db (29467)
Plugin: jts (29613)
Plugin: log4j (29435)
Plugin: pbf (29435)
Plugin: print (29529)
Plugin: routing (29596)
Plugin: turnlanes (29435)
Plugin: turnrestrictions (29435)

java.lang.NullPointerException
	at org.openstreetmap.josm.data.coor.LatLon.greatCircleDistance(LatLon.java:231)
	at com.innovant.josm.jrt.core.RoutingGraph.addEdge(RoutingGraph.java:243)
	at com.innovant.josm.jrt.core.RoutingGraph.addEdgeBidirectional(RoutingGraph.java:115)
	at com.innovant.josm.jrt.core.RoutingGraph.createGraph(RoutingGraph.java:213)
	at com.innovant.josm.plugin.routing.RoutingLayer.<init>(RoutingLayer.java:127)
	at com.innovant.josm.plugin.routing.RoutingPlugin.addLayer(RoutingPlugin.java:178)
	at com.innovant.josm.plugin.routing.gui.RoutingMenu$1.actionPerformed(RoutingMenu.java:82)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:374)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:829)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:873)
	at java.awt.Component.processMouseEvent(Component.java:6288)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6053)
	at java.awt.Container.processEvent(Container.java:2045)
	at java.awt.Component.dispatchEventImpl(Component.java:4649)
	at java.awt.Container.dispatchEventImpl(Container.java:2103)
	at java.awt.Component.dispatchEvent(Component.java:4475)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
	at java.awt.Container.dispatchEventImpl(Container.java:2089)
	at java.awt.Window.dispatchEventImpl(Window.java:2587)
	at java.awt.Component.dispatchEvent(Component.java:4475)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:675)
	at java.awt.EventQueue.access$300(EventQueue.java:96)
	at java.awt.EventQueue$2.run(EventQueue.java:634)
	at java.awt.EventQueue$2.run(EventQueue.java:632)
	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$3.run(EventQueue.java:648)
	at java.awt.EventQueue$3.run(EventQueue.java:646)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:645)
	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 (0)

Change History (3)

comment:1 by Don-vip, 11 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

Fixed in [o29629].

comment:2 by ksmlgl, 8 years ago

After this fix, i think the RoutingGraph addEdge method can not work accurately.
I think, the code block should be changed as below:

private void addEdge(Way way, Node from, Node to) {

OsmEdge edge = new OsmEdge(way, from, to);
double length = edge.getLength();
edge.setSpeed(12.1);
graph.addEdge(from, to, edge);
weight = getWeight(way);
double weight = getWeight(way, length);
setWeight(edge, length);
logger.debug("edge for way " + way.getId() + "(from node " + from.getId() + " to node " + to.getId()

+ ") has weight: " + weight);

((DirectedWeightedMultigraph<Node, OsmEdge>) graph).setEdgeWeight(edge, weight);

}

Last edited 8 years ago by ksmlgl (previous) (diff)

comment:3 by stoecker, 8 years ago

Please don't add comments to already closed tickets. Create a new ticket and be a bit more verbose in your description. Also patch format is preferred, as that helps to understand what changes you actually suggest.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain franpd.
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.