Merge pull request #547 from afischerdev/roundabout
Rework on roundabout
This commit is contained in:
commit
7b04e0bde2
1 changed files with 6 additions and 2 deletions
|
@ -60,6 +60,7 @@ public final class VoiceHintProcessor {
|
|||
float roundAboutTurnAngle = 0.f; // sums up angles in roundabout
|
||||
|
||||
int roundaboutExit = 0;
|
||||
int roundaboudStartIdx = -1;
|
||||
|
||||
for (int hintIdx = 0; hintIdx < inputs.size(); hintIdx++) {
|
||||
VoiceHint input = inputs.get(hintIdx);
|
||||
|
@ -77,7 +78,8 @@ public final class VoiceHintProcessor {
|
|||
boolean isLink2Highway = input.oldWay.isLinktType() && !input.goodWay.isLinktType();
|
||||
boolean isHighway2Link = !input.oldWay.isLinktType() && input.goodWay.isLinktType();
|
||||
|
||||
if (input.oldWay.isRoundabout()) {
|
||||
if (explicitRoundabouts && input.oldWay.isRoundabout()) {
|
||||
if (roundaboudStartIdx == -1) roundaboudStartIdx = hintIdx;
|
||||
roundAboutTurnAngle += sumNonConsumedWithinCatchingRange(inputs, hintIdx);
|
||||
boolean isExit = roundaboutExit == 0; // exit point is always exit
|
||||
if (input.badWays != null) {
|
||||
|
@ -94,13 +96,15 @@ public final class VoiceHintProcessor {
|
|||
}
|
||||
if (roundaboutExit > 0) {
|
||||
roundAboutTurnAngle += sumNonConsumedWithinCatchingRange(inputs, hintIdx);
|
||||
double startTurn = (roundaboudStartIdx != -1 ? inputs.get(roundaboudStartIdx).goodWay.turnangle : turnAngle);
|
||||
input.angle = roundAboutTurnAngle;
|
||||
input.distanceToNext = distance;
|
||||
input.roundaboutExit = turnAngle < 0 ? -roundaboutExit : roundaboutExit;
|
||||
input.roundaboutExit = startTurn < 0 ? -roundaboutExit : roundaboutExit;
|
||||
distance = 0.;
|
||||
results.add(input);
|
||||
roundAboutTurnAngle = 0.f;
|
||||
roundaboutExit = 0;
|
||||
roundaboudStartIdx = -1;
|
||||
continue;
|
||||
}
|
||||
int maxPrioAll = -1; // max prio of all detours
|
||||
|
|
Loading…
Reference in a new issue