Cannot calculate turn angle for some roundabouts

Author: boldtrnCreated Mar 16, 2023Updated Sep 8, 2026
Labelsbug

Describe the bug

For some roundabouts GraphHopper can't calculate a turn angle.

To Reproduce

Steps to reproduce the behavior. For examples:

https://graphhopper.com/maps/?point=48.090358%2C11.317195&point=48.099875%2C11.312409&profile=car

The first and third roundabout in this route don't have a turn angle.

Expected behavior

All roundabouts should have a turn angle.

I debugged the case, we are setting RoundaboutInstruction#setDirOfRotation twice, once with a positive and once with a negative value, which will set clockwise to 2, which will lead to NaN in RoundaboutInstruction#getTurnAngle.