From ca04c3c1d7fdd3ad5a196c66f39d6b0c2015f4c8 Mon Sep 17 00:00:00 2001 From: sonora Date: Mon, 19 Mar 2012 20:01:41 +0100 Subject: [PATCH] harmonize all GPS tolerance distances to 60m --- OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 49a3e51c61..b6c65b90e0 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -264,12 +264,12 @@ public class RoutingHelper { } } - // 4. >50m away from current routeNode? Then re-calculate route. + // 4. >60m away from current routeNode? Then re-calculate route. if(currentRoute > 0){ float bearing = routeNodes.get(currentRoute - 1).bearingTo(routeNodes.get(currentRoute)); float bearingMovement = currentLocation.bearingTo(routeNodes.get(currentRoute)); float d = Math.abs(currentLocation.distanceTo(routeNodes.get(currentRoute)) * FloatMath.sin((bearingMovement - bearing)*3.14f/180f)); - if(d > 50) { + if(d > 60) { log.info("Recalculate route, because correlation : " + d); //$NON-NLS-1$ calculateRoute = true; } @@ -278,7 +278,7 @@ public class RoutingHelper { // 5. Sum distance to last and current route nodes if(!calculateRoute){ float d = currentLocation.distanceTo(routeNodes.get(currentRoute)); - if (d > 80) { + if (d > 60) { if (currentRoute > 0) { // 5a. Greater than 2*distance between them? Then re-calculate route. (Case often covered by 4., but still needed.) float f1 = currentLocation.distanceTo(routeNodes.get(currentRoute - 1)) + d; @@ -306,7 +306,7 @@ public class RoutingHelper { lastFixedLocation = currentLocation; // 8. Strange Direction? Then re-calculate route. (Added new, may possibly even replace triggers 4, 5a, 5b ?) - if(suppressTurnPrompt && (currentLocation.distanceTo(routeNodes.get(currentRoute)) > 100) ){ + if(suppressTurnPrompt && (currentLocation.distanceTo(routeNodes.get(currentRoute)) > 60) ){ calculateRoute = true; } @@ -329,7 +329,7 @@ public class RoutingHelper { float bearing = routeNodes.get(currentRoute - 1).bearingTo(routeNodes.get(currentRoute)); float bearingMovement = currentLocation.bearingTo(routeNodes.get(currentRoute)); float d = Math.abs(currentLocation.distanceTo(routeNodes.get(currentRoute)) * FloatMath.sin((bearingMovement - bearing)*3.14f/180f)); - if(d > 50){ + if(d > 60){ processed = true; } } else {