From 3c1104b1d0c431925f04765355fa852fe3509578 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Mon, 3 Mar 2014 18:44:17 +0100 Subject: [PATCH] Improve gpx route calculation --- OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java | 4 ++-- OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java index 4a222c8acb..e8091b06a4 100644 --- a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java @@ -384,9 +384,9 @@ public class BinaryRoutePlanner { float distStartObstacles = segment.distanceFromStart + calculateTimeWithObstacles(ctx, road, segmentDist , obstaclesTime); if(ctx.precalculatedRouteDirection != null && ctx.precalculatedRouteDirection.isFollowNext()) { // reset to f - distStartObstacles = 0; +// distStartObstacles = 0; // more precise but slower - //distStartObstacles = ctx.precalculatedRouteDirection.getDeviationDistance(x, y) / ctx.getRouter().getMinDefaultSpeed(); + distStartObstacles = ctx.precalculatedRouteDirection.getDeviationDistance(x, y) / ctx.getRouter().getMaxDefaultSpeed(); } // We don't check if there are outgoing connections diff --git a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java index 8d7f61e3ae..1e2bfd5ac9 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java @@ -122,7 +122,7 @@ public class RoutePlannerFrontEnd { if(res != null) { new RouteResultPreparation().printResults(ctx, start, end, res); } - return res; + return res; } int indexNotFound = 0; List points = new ArrayList();