fix bug cause roundabout based on circle is completely incorrect
This commit is contained in:
parent
b8787e4121
commit
97e6395def
1 changed files with 1 additions and 10 deletions
|
@ -1187,14 +1187,11 @@ public class RouteResultPreparation {
|
||||||
RouteSegmentResult rr) {
|
RouteSegmentResult rr) {
|
||||||
int exit = 1;
|
int exit = 1;
|
||||||
RouteSegmentResult last = rr;
|
RouteSegmentResult last = rr;
|
||||||
RouteSegmentResult firstRoundabout = rr;
|
|
||||||
RouteSegmentResult lastRoundabout = rr;
|
|
||||||
|
|
||||||
for (int j = i; j < result.size(); j++) {
|
for (int j = i; j < result.size(); j++) {
|
||||||
RouteSegmentResult rnext = result.get(j);
|
RouteSegmentResult rnext = result.get(j);
|
||||||
last = rnext;
|
last = rnext;
|
||||||
if (rnext.getObject().roundabout()) {
|
if (rnext.getObject().roundabout()) {
|
||||||
lastRoundabout = rnext;
|
|
||||||
boolean plus = rnext.getStartPointIndex() < rnext.getEndPointIndex();
|
boolean plus = rnext.getStartPointIndex() < rnext.getEndPointIndex();
|
||||||
int k = rnext.getStartPointIndex();
|
int k = rnext.getStartPointIndex();
|
||||||
if (j == i) {
|
if (j == i) {
|
||||||
|
@ -1216,13 +1213,7 @@ public class RouteResultPreparation {
|
||||||
TurnType t = TurnType.getExitTurn(exit, 0, leftSide);
|
TurnType t = TurnType.getExitTurn(exit, 0, leftSide);
|
||||||
// usually covers more than expected
|
// usually covers more than expected
|
||||||
float turnAngleBasedOnOutRoads = (float) MapUtils.degreesDiff(last.getBearingBegin(), prev.getBearingEnd());
|
float turnAngleBasedOnOutRoads = (float) MapUtils.degreesDiff(last.getBearingBegin(), prev.getBearingEnd());
|
||||||
// usually covers less than expected
|
t.setTurnAngle(turnAngleBasedOnOutRoads) ;
|
||||||
float turnAngleBasedOnCircle = (float) -MapUtils.degreesDiff(firstRoundabout.getBearingBegin(), lastRoundabout.getBearingEnd() + 180);
|
|
||||||
if(Math.abs(turnAngleBasedOnOutRoads - turnAngleBasedOnCircle) > 180) {
|
|
||||||
t.setTurnAngle(turnAngleBasedOnCircle) ;
|
|
||||||
} else {
|
|
||||||
t.setTurnAngle(turnAngleBasedOnOutRoads) ;
|
|
||||||
}
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue