From 3b61afd1fedf26437f85d84a620ef311b5149c8c Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 11 Aug 2016 16:44:10 +0200 Subject: [PATCH] refine travel time solution --- OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index c1c2ccbdad..1eb6eb4a92 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -570,7 +570,7 @@ public class RouteCalculationResult { type = diff > 0 ? TurnType.KL : TurnType.KR; } // AvgSpeed = 999999 for the last turn prevents the turn to have noticeable impact on travel time totalling if calculated route ends on a GPX route segment - RouteDirectionInfo info = new RouteDirectionInfo(999999, TurnType.valueOf(type, false)); + RouteDirectionInfo info = new RouteDirectionInfo(lastDirInf != null ? lastDirInf.getAverageSpeed() : 1, TurnType.valueOf(type, false)); info.distance = 0; info.afterLeftTime = 0; info.routePointOffset = locations.size() - 1;