Skip to content

Commit

Permalink
refactor(StatesToWalkStepsMapper): Don't recombine streets without mo…
Browse files Browse the repository at this point in the history
…bility profile.
  • Loading branch information
binh-dam-ibigroup committed Apr 23, 2024
1 parent 2218a9f commit c23fc28
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,22 @@ private void processState(State backState, State forwardState) {
edge.isRoundabout()
);

if (shouldOverwriteCurrentDirectionText(edge, direction)) {
// HACK: If the instruction is "continue", the current street name is bogus and its length is very short (< 10 meters)
// but not the next edge one, use the next street name and don't start a new step.
current.withDirectionText(I18NString.of(streetNameNoParens));
current.withBogusName(false);
}
if (
edge instanceof StreetEdge streetEdge && shouldOverwriteEdgeDirectionText(edge, direction)
) {
// HACK: Similar hack if the next edge name is bogus and its length is very short (< 10 meters)
// but not the current step. In this case, continue using the current street name and don't start a new step.
streetNameNoParens = current.directionTextNoParens();
streetEdge.setName(current.directionText());
streetEdge.setBogusName(false);
// G-MAP-specific: Overwrite the name on short street edges so they are merged with longer street
// sections to clean up turn-by-turn instructions.
if (edge instanceof StreetEdge streetEdge && !streetEdge.profileCost.isEmpty()) {
if (shouldOverwriteCurrentDirectionText(edge, direction)) {
// HACK: If the instruction is "continue", the current street name is bogus and its length is very short (< 10 meters)
// but not the next edge one, use the next street name and don't start a new step.
current.withDirectionText(I18NString.of(streetNameNoParens));
current.withBogusName(false);
}
if (shouldOverwriteEdgeDirectionText(edge, direction)) {
// HACK: Similar hack if the next edge name is bogus and its length is very short (< 10 meters)
// but not the current step. In this case, continue using the current street name and don't start a new step.
streetNameNoParens = current.directionTextNoParens();
streetEdge.setName(current.directionText());
streetEdge.setBogusName(false);
}
}

if (
Expand Down

0 comments on commit c23fc28

Please sign in to comment.