Fix slight turns on motorway

This commit is contained in:
Victor Shcherb 2013-04-21 13:08:21 +02:00
parent 6803a1bf0f
commit e9eee09a40
2 changed files with 9 additions and 0 deletions

View file

@ -1 +1,2 @@
bin bin
OsmAnd-core.jar

View file

@ -481,6 +481,7 @@ public class RouteResultPreparation {
// } // }
double devation = Math.abs(MapUtils.degreesDiff(prevSegm.getBearingEnd(), currentSegm.getBearingBegin())); double devation = Math.abs(MapUtils.degreesDiff(prevSegm.getBearingEnd(), currentSegm.getBearingBegin()));
boolean makeSlightTurn = devation > 5 && (!isMotorway(prevSegm) || !isMotorway(currentSegm));
if (kl) { if (kl) {
t = TurnType.valueOf(devation > 5 ? TurnType.TSLL : TurnType.KL, leftSide); t = TurnType.valueOf(devation > 5 ? TurnType.TSLL : TurnType.KL, leftSide);
t.setSkipToSpeak(!speak); t.setSkipToSpeak(!speak);
@ -495,6 +496,13 @@ public class RouteResultPreparation {
return t; return t;
} }
private boolean isMotorway(RouteSegmentResult s){
String h = s.getObject().getHighway();
return "motorway".equals(h) || "motorway_link".equals(h) ||
"trunk".equals(h) || "trunk_link".equals(h);
}
private void attachRoadSegments(RoutingContext ctx, List<RouteSegmentResult> result, int routeInd, int pointInd, boolean plus) throws IOException { private void attachRoadSegments(RoutingContext ctx, List<RouteSegmentResult> result, int routeInd, int pointInd, boolean plus) throws IOException {
RouteSegmentResult rr = result.get(routeInd); RouteSegmentResult rr = result.get(routeInd);