From 371e60b3af447771fb1ffb68e0079936f0fc3c66 Mon Sep 17 00:00:00 2001 From: Kseniia Date: Thu, 7 Jan 2021 21:28:35 +0200 Subject: [PATCH 1/2] add condition for 0 planRoadDirection --- .../src/main/java/net/osmand/router/BinaryRoutePlanner.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java index ebfe18940c..5309866f45 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java @@ -543,6 +543,10 @@ public class BinaryRoutePlanner { } break; } + + if (from.getRoad().getRestrictionType(i) == MapRenderingTypes.RESTRICTION_ONLY_STRAIGHT_ON) { + return false; + } } } return true; From 80f083cf3a4faa6614791ff95807a0887cd45729 Mon Sep 17 00:00:00 2001 From: Kseniia Date: Thu, 7 Jan 2021 21:30:15 +0200 Subject: [PATCH 2/2] add condition for 0 planRoadDirection --- .../java/net/osmand/router/BinaryRoutePlanner.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java index 5309866f45..dabefe81b3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/BinaryRoutePlanner.java @@ -533,18 +533,17 @@ public class BinaryRoutePlanner { long fid = to.getRoad().getId(); for (int i = 0; i < from.getRoad().getRestrictionLength(); i++) { long id = from.getRoad().getRestrictionId(i); + int tp = from.getRoad().getRestrictionType(i); if (fid == id) { - int tp = from.getRoad().getRestrictionType(i); - if (tp == MapRenderingTypes.RESTRICTION_NO_LEFT_TURN || - tp == MapRenderingTypes.RESTRICTION_NO_RIGHT_TURN || - tp == MapRenderingTypes.RESTRICTION_NO_STRAIGHT_ON || - tp == MapRenderingTypes.RESTRICTION_NO_U_TURN) { + if (tp == MapRenderingTypes.RESTRICTION_NO_LEFT_TURN + || tp == MapRenderingTypes.RESTRICTION_NO_RIGHT_TURN + || tp == MapRenderingTypes.RESTRICTION_NO_STRAIGHT_ON + || tp == MapRenderingTypes.RESTRICTION_NO_U_TURN) { return false; } break; } - - if (from.getRoad().getRestrictionType(i) == MapRenderingTypes.RESTRICTION_ONLY_STRAIGHT_ON) { + if (tp == MapRenderingTypes.RESTRICTION_ONLY_STRAIGHT_ON) { return false; } }