Graphhopper is not working with turn restriction config

Hello everyone, I don’t know why my web is not working with turn restriction config. I hope you help me fix this error. Thank you so much!


AFAIK to enable turn restrictions you have to:

  • update graph.flag_encoders (as you did)
  • add turn_costs: true to your profile configuration:
profiles:
    - name: my_bike /* or how you call it */
      vehicle: bike
      weighting: fastest
      turn_costs: true
1 Like

You should even be able to leave out the entire graph.flag_encoders entry. It will be determined implicitly from the profile vehicles (and the turn_costs field of the profiles).

1 Like

Thank you so much. I don’t know if activating turn_restriction will affect performance because as far as I know, using turn_restriction means disable CH.

Thank you so much. I don’t know if activating turn_restriction will affect performance because as far as I know, using turn_restriction means disable CH.

No, CH also supports turn restrictions since version 1.0 (or even earlier). Activating turn costs will make the routing slower, but for example CH with turn costs is still orders of magnitudes faster than routing without turn costs without CH. CH with turn costs needs a longer preparation and requires more memory though. See also this article: Host Your Own Worldwide Route Calculator With GraphHopper - GraphHopper Directions API

1 Like
Powered by Discourse