From b523294d6d2d6a67528ae9488aa442831ec6e36c Mon Sep 17 00:00:00 2001 From: Kseniia Date: Thu, 21 Jan 2021 15:49:04 +0200 Subject: [PATCH] fix turn angle for roundabout --- .../main/java/net/osmand/router/RouteResultPreparation.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java index 4df69c3adc..36c3f55586 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -1189,6 +1189,7 @@ public class RouteResultPreparation { RouteSegmentResult last = rr; RouteSegmentResult firstRoundabout = rr; RouteSegmentResult lastRoundabout = rr; + for (int j = i; j < result.size(); j++) { RouteSegmentResult rnext = result.get(j); last = rnext; @@ -1218,9 +1219,9 @@ public class RouteResultPreparation { // usually covers less than expected float turnAngleBasedOnCircle = (float) -MapUtils.degreesDiff(firstRoundabout.getBearingBegin(), lastRoundabout.getBearingEnd() + 180); if(Math.abs(turnAngleBasedOnOutRoads - turnAngleBasedOnCircle) > 180) { - t.setTurnAngle(turnAngleBasedOnCircle ) ; + t.setTurnAngle(turnAngleBasedOnCircle) ; } else { - t.setTurnAngle((turnAngleBasedOnCircle + turnAngleBasedOnOutRoads) / 2) ; + t.setTurnAngle(turnAngleBasedOnOutRoads) ; } return t; }