@@ -449,11 +449,11 @@ public PointSetTimes eval (
449449 if (origin != null && origin .edge == edges [i ]) {
450450 // The target point lies along the same edge as the origin
451451 int onStreetDistance_mm = Math .abs (origin .distance0_mm - distances0_mm [i ]);
452- travelTimes [i ] = // origin.distanceToEdge_mm / offStreetSpeed + TODO origin to origin split point
452+ travelTimes [i ] = origin .distanceToEdge_mm / offStreetSpeed +
453453 onStreetDistance_mm / onStreetSpeed + // along street
454454 distancesToEdge_mm [i ] / offStreetSpeed ; // from destination split point to destination
455455 } else {
456- travelTimes [i ] = timeToPoint (timeToVertex , edge , i , onStreetSpeed );
456+ travelTimes [i ] = timeToPoint (timeToVertex , edge , i , onStreetSpeed , offStreetSpeed );
457457 }
458458 }
459459 return new PointSetTimes (pointSet , travelTimes );
@@ -526,7 +526,7 @@ public int[] extendCostsToPoints(CostToVertexFunction costToVertex,
526526 // The routing variable is seconds only if we're doing a car search, so look up the car speed on the
527527 // linked edge.
528528 int onStreetSpeed = (int ) (edge .getCarSpeedMetersPerSecond () * 1000 );
529- cost = timeToPoint (costToVertex , edge , p , onStreetSpeed );
529+ cost = timeToPoint (costToVertex , edge , p , onStreetSpeed , OFF_STREET_SPEED_MILLIMETERS_PER_SECOND );
530530 }
531531
532532 if (cost != Integer .MAX_VALUE ) {
@@ -607,13 +607,14 @@ private int distanceToPoint(CostToVertexFunction costToVertex, Edge edge, int po
607607 * @param onStreetSpeed speed at which the destination edge (to which the target is linked) is traversed
608608 * @return minimum time needed to reach point, or Integer.MAX_VALUE if point is not reachable.
609609 */
610- private int timeToPoint (CostToVertexFunction costToVertex , Edge edge , int pointIndex , int onStreetSpeed ) {
610+ private int timeToPoint (CostToVertexFunction costToVertex , Edge edge , int pointIndex , int onStreetSpeed ,
611+ int offStreetSpeed ) {
611612 int time0 = costToVertex .getCost (edge .getFromVertex ());
612613 int time1 = costToVertex .getCost (edge .getToVertex ());
613614 if (time0 == Integer .MAX_VALUE && time1 == Integer .MAX_VALUE ) {
614615 return Integer .MAX_VALUE ;
615616 } else {
616- int offStreetTime = distancesToEdge_mm [pointIndex ] / OFF_STREET_SPEED_MILLIMETERS_PER_SECOND ;
617+ int offStreetTime = distancesToEdge_mm [pointIndex ] / offStreetSpeed ;
617618 time0 += distances0_mm [pointIndex ] / onStreetSpeed + offStreetTime ;
618619 time1 += distances1_mm [pointIndex ] / onStreetSpeed + offStreetTime ;
619620 return Math .min (handleOverflow (time0 ), handleOverflow (time1 ));
0 commit comments