@@ -158,6 +158,18 @@ void TransferTurnTypeStrategy::operator()(RouteStep &step_at_turn_location,
158158void AdjustToCombinedTurnAngleStrategy::operator ()(RouteStep &step_at_turn_location,
159159 const RouteStep &transfer_from_step) const
160160{
161+ // Forks point to left/right. By doing a combined angle, we would risk ending up with
162+ // unreasonable fork instrucitons. The direction of a fork only depends on the forking location,
163+ // not further angles coming up
164+ //
165+ // d
166+ // . c
167+ // a - b
168+ //
169+ // could end up as `fork left` for `a-b-c`, instead of fork-right
170+ if (hasTurnType (step_at_turn_location, TurnType::Fork))
171+ return ;
172+
161173 // TODO assert transfer_from_step == step_at_turn_location + 1
162174 const auto angle = findTotalTurnAngle (step_at_turn_location, transfer_from_step);
163175 step_at_turn_location.maneuver .instruction .direction_modifier = getTurnDirection (angle);
@@ -173,7 +185,19 @@ void AdjustToCombinedTurnStrategy::operator()(RouteStep &step_at_turn_location,
173185 const RouteStep &transfer_from_step) const
174186{
175187 const auto angle = findTotalTurnAngle (step_at_turn_location, transfer_from_step);
176- const auto new_modifier = getTurnDirection (angle);
188+
189+ // Forks point to left/right. By doing a combined angle, we would risk ending up with
190+ // unreasonable fork instrucitons. The direction of a fork only depends on the forking location,
191+ // not further angles coming up
192+ //
193+ // d
194+ // . c
195+ // a - b
196+ //
197+ // could end up as `fork left` for `a-b-c`, instead of fork-right
198+ const auto new_modifier = hasTurnType (step_at_turn_location, TurnType::Fork)
199+ ? step_at_turn_location.maneuver .instruction .direction_modifier
200+ : getTurnDirection (angle);
177201
178202 // a turn that is a new name or straight (turn/continue)
179203 const auto is_non_turn = [](const RouteStep &step) {
0 commit comments