This commit is contained in:
Victor Shcherb 2021-03-22 19:57:34 +01:00
parent 8dbe502907
commit 35d72bdbaa
2 changed files with 4 additions and 4 deletions

View file

@ -1117,8 +1117,8 @@ public class RouteResultPreparation {
if (UNMATCHED_HIGHWAY_TYPE.equals(rr.getObject().getHighway())) { if (UNMATCHED_HIGHWAY_TYPE.equals(rr.getObject().getHighway())) {
bearingDist = RouteSegmentResult.DIST_BEARING_DETECT_UNMATCHED; bearingDist = RouteSegmentResult.DIST_BEARING_DETECT_UNMATCHED;
} }
double mpi = MapUtils.degreesDiff(prev.getBearingEnd(prev.getEndPointIndex(), bearingDist), double mpi = MapUtils.degreesDiff(prev.getBearingEnd(prev.getEndPointIndex(), Math.min(prev.getDistance(), bearingDist)),
rr.getBearingBegin(rr.getStartPointIndex(), bearingDist)); rr.getBearingBegin(rr.getStartPointIndex(), Math.min(rr.getDistance(), bearingDist)));
if (mpi >= TURN_DEGREE_MIN) { if (mpi >= TURN_DEGREE_MIN) {
if (mpi < TURN_DEGREE_MIN) { if (mpi < TURN_DEGREE_MIN) {
// Slight turn detection here causes many false positives where drivers would expect a "normal" TL. Best use limit-angle=TURN_DEGREE_MIN, this reduces TSL to the turn-lanes cases. // Slight turn detection here causes many false positives where drivers would expect a "normal" TL. Best use limit-angle=TURN_DEGREE_MIN, this reduces TSL to the turn-lanes cases.

View file

@ -457,7 +457,7 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
} }
public float getBearingBegin() { public float getBearingBegin() {
return getBearingBegin(startPointIndex, DIST_BEARING_DETECT); return getBearingBegin(startPointIndex, distance > 0 && distance < DIST_BEARING_DETECT ? distance : DIST_BEARING_DETECT);
} }
public float getBearingBegin(int point, float dist) { public float getBearingBegin(int point, float dist) {
@ -465,7 +465,7 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
} }
public float getBearingEnd() { public float getBearingEnd() {
return getBearingEnd(endPointIndex, DIST_BEARING_DETECT); return getBearingEnd(endPointIndex, distance > 0 && distance < DIST_BEARING_DETECT ? distance : DIST_BEARING_DETECT);
} }
public float getBearingEnd(int point, float dist) { public float getBearingEnd(int point, float dist) {