From 58fe2b79aa7772ed576946da50f2aa6feb4ef3a0 Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 24 May 2016 10:42:36 +0200 Subject: [PATCH] create test build for suppression of ghost turns where regular turn is already indicated --- .../src/net/osmand/router/RouteResultPreparation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index b3ee5c6908..db5ef787f3 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -795,7 +795,7 @@ public class RouteResultPreparation { } protected TurnType createKeepLeftRightTurnBasedOnTurnTypes(RoadSplitStructure rs, RouteSegmentResult prevSegm, - RouteSegmentResult currentSegm, String turnLanes,boolean leftSide) { + RouteSegmentResult currentSegm, String turnLanes, boolean leftSide) { // Maybe going straight at a 90-degree intersection TurnType t = TurnType.valueOf(TurnType.C, leftSide); int[] rawLanes = calculateRawTurnLanes(turnLanes, TurnType.C); @@ -837,6 +837,10 @@ public class RouteResultPreparation { } } } + //Test suppressing 'ghost turns' where lanes split with no action (go staight) or a subsequent turn will be announced anyway. This mostly causes Issue 2571. + if (t == TurnType.valueOf(TurnType.C, leftSide)) { + rs.speak = false; + } t.setSkipToSpeak(!rs.speak); t.setLanes(rawLanes); return t; @@ -930,6 +934,7 @@ public class RouteResultPreparation { TurnType t = null; if (rs.keepLeft && rs.keepRight) { t = TurnType.valueOf(TurnType.C, leftSide); + rs.speak = false; } else if (rs.keepLeft) { t = TurnType.valueOf(makeSlightTurn ? TurnType.TSLL : TurnType.KL, leftSide); } else if (rs.keepRight) {