From 4ed2414c95fed3de46a240ba80f4bf5ff6565d41 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 15 Jul 2018 12:45:01 +0200 Subject: [PATCH] Fix U-turn identification for GPX based routing --- .../plus/routing/RouteCalculationResult.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index afd6f7afd2..645a8c17eb 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -415,9 +415,25 @@ public class RouteCalculationResult { } else if(delta < 150){ type = TurnType.valueOf(TurnType.TSHL, leftSide); description = ctx.getString( R.string.route_tshl); - } else if(delta < 210){ + } else if(delta < 180){ + if(leftSide) { + type = TurnType.valueOf(TurnType.TSHL, leftSide); + description = ctx.getString( R.string.route_tshl); + } else { + type = TurnType.valueOf(TurnType.TU, leftSide); + description = ctx.getString( R.string.route_tu); + } + } else if(delta == 180){ type = TurnType.valueOf(TurnType.TU, leftSide); description = ctx.getString( R.string.route_tu); + } else if(delta < 210){ + if(leftSide) { + type = TurnType.valueOf(TurnType.TU, leftSide); + description = ctx.getString( R.string.route_tu); + } else { + description = ctx.getString( R.string.route_tshr); + type = TurnType.valueOf(TurnType.TSHR, leftSide); + } } else if(delta < 240){ description = ctx.getString( R.string.route_tshr); type = TurnType.valueOf(TurnType.TSHR, leftSide);