diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index e4a1d69649..a066d14946 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -743,9 +743,9 @@ public class RouteResultPreparation { } } } - if(straightActiveLen == target.activeLen) { + if(straightActiveBegin != -1 && straightActiveLen <= target.activeLen) { active.activeStartIndex = straightActiveBegin; - active.activeEndIndex = straightActiveBegin + target.activeLen - 1; + active.activeEndIndex = straightActiveBegin + straightActiveLen - 1; changed = true; } else { // cause the next-turn goes forward exclude left most and right most lane diff --git a/OsmAnd-java/src/net/osmand/router/TurnType.java b/OsmAnd-java/src/net/osmand/router/TurnType.java index 873825c0ea..c1f4e4bd88 100644 --- a/OsmAnd-java/src/net/osmand/router/TurnType.java +++ b/OsmAnd-java/src/net/osmand/router/TurnType.java @@ -416,11 +416,13 @@ public class TurnType { public static int convertType(String lane) { int turn; // merge should be recognized as continue route (but it could displayed differently) - if (lane.equals("none") || lane.equals("through") - || lane.equals("merge_to_left") - || lane.equals("merge_to_right")) { + if(lane.equals("merge_to_left")) { turn = TurnType.C; - } else if (lane.equals("slight_right") ) { + } else if(lane.equals("merge_to_right")) { + turn = TurnType.C; + } else if (lane.equals("none") || lane.equals("through")) { + turn = TurnType.C; + } else if (lane.equals("slight_right")) { turn = TurnType.TSLR; } else if (lane.equals("slight_left") ) { turn = TurnType.TSLL; diff --git a/OsmAnd-java/test/resources/test_turn_lanes.json b/OsmAnd-java/test/resources/test_turn_lanes.json index 8598eee117..b743a2e731 100644 --- a/OsmAnd-java/test/resources/test_turn_lanes.json +++ b/OsmAnd-java/test/resources/test_turn_lanes.json @@ -595,8 +595,8 @@ }, "expectedResults": { "222244": "TL|TL|+C,TR", - "222243": "TL|TL|+C|C|TSLR", - "222164": "TL|TL|+C|C" + "222243": "TL|TL|+C|+C|TSLR", + "222164": "TL|TL|+C|+C" } }, {