Changeset 29629 in osm for applications/editors/josm/plugins/routing
- Timestamp:
- 2013-06-06T13:01:27+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java
r28138 r29629 38 38 import org.jgrapht.graph.DirectedWeightedMultigraph; 39 39 import org.openstreetmap.josm.Main; 40 import org.openstreetmap.josm.data.coor.LatLon; 40 41 import org.openstreetmap.josm.data.osm.DataSet; 41 42 import org.openstreetmap.josm.data.osm.Node; … … 241 242 */ 242 243 private void addEdge(Way way,Node from, Node to) { 243 double length = from.getCoor().greatCircleDistance(to.getCoor()); 244 LatLon fromLL = from.getCoor(); 245 LatLon toLL = from.getCoor(); 246 if (fromLL == null || toLL == null) { 247 return; 248 } 249 double length = fromLL.greatCircleDistance(toLL); 244 250 245 251 OsmEdge edge = new OsmEdge(way, from, to); … … 252 258 + "(from node " + from.getId() + " to node " 253 259 + to.getId() + ") has weight: " + weight); 254 //((GraphDelegator<Node,OsmEdge>) graph).setEdgeWeight(edge, weight);255 260 ((DirectedWeightedMultigraph<Node,OsmEdge>)graph).setEdgeWeight(edge, weight); 256 261 }
Note:
See TracChangeset
for help on using the changeset viewer.