From 9072c9730033f5633d70efdff383f5192cbfc1d1 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 23 Jan 2021 14:27:01 +0100 Subject: [PATCH] Add comments --- .../main/java/net/osmand/router/RouteResultPreparation.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 44c48f69ec..26d984b2da 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteResultPreparation.java @@ -1216,6 +1216,12 @@ public class RouteResultPreparation { TurnType t = TurnType.getExitTurn(exit, 0, leftSide); // usually covers more than expected float turnAngleBasedOnOutRoads = (float) MapUtils.degreesDiff(last.getBearingBegin(), prev.getBearingEnd()); + // Angle based on circle method tries + // 1. to calculate antinormal to roundabout circle on roundabout entrance and + // 2. normal to roundabout circle on roundabout exit + // 3. calculate angle difference + // This method doesn't work if you go from S to N touching only 1 point of roundabout, + // but it is very important to identify very sharp or very large angle to understand did you pass whole roundabout or small entrance float turnAngleBasedOnCircle = (float) -MapUtils.degreesDiff(firstRoundabout.getBearingBegin(), lastRoundabout.getBearingEnd() + 180); if (Math.abs(turnAngleBasedOnOutRoads) > 120) { // correctly identify if angle is +- 180, so we approach from left or right side