Skip to content

Bug/Question: turn costs and turning points #3181

Closed as duplicate
Closed as duplicate

Description

@Vectorial1024

Describe the bug
This feels like a bug, but perhaps I am misunderstanding things. I have been tinkering with GraphHopper for a while, but I can't fully understand how GraphHopper handles OSM turning points.

My opinion is that GraphHopper is not handling OSM turning points correctly.

Here, turning points are defined to be nodes with highway=turning_circle or highway=turning_loop or highway=mini_roundabout, or anything equivalent that I am not aware of.

To Reproduce
Consider the following live example:

https://graphhopper.com/maps/?point=22.29109%2C114.273748&point=22.291051%2C114.273394&profile=car&layer=OpenStreetMap

Image

Note: this is a valid path because turn restrictions etc are correctly considered.

Expected behavior
While the above was valid, I do not think it was correct. It confuses me that GraphHopper does not consider the following path:

Image

It is shorter, and should obviously be comparable to the un-forced solution. (Note that both roads have max_speed=50 so the shorter one should be better.)

This is most definitely related to how GraphHopper currently handles "sharp turns" (see #2139).

While prior discussion is fruitful, I would like to add that, perhaps we forgot about turning points.

We put a lot of effort to deal with unauthorized u-turns, and from my current understanding, the current solution revolves around the "u-turn cost" concept, which make sense for "usual" u-turns. There aren't usually any space to do these "usual" u-turns, so this usually requires the driver to do a "T-shaped maneuver" (don't know the proper term) like this to turn around:

Image

This can be tedious and time-consuming depending on the skill level of the driver; alternatively, this can be time-consuming because modern vehicles often use a safe (aka very low) speed to drive in reverse. By adding a high cost to paths that are doing these "usual" u-turns, we can avoid them, which is correct.

However, for OSM turning points, the roads are actually built to have extra space for turning around, so the turning around is simply trivial, like this:

Image

Just like that, and the u-turn is complete. It does not make sense to impose any u-turn cost for these dedicated turning points. Even if a cost has to be applied, the cost should be applied at a discount.

In other words, these turning points are like mini-roundabouts. When actual roundabouts have no applied u-turn costs, it makes excellent sense that these turning points should also have no applied u-turn costs.

System Information
Live website.

Activity

  1. easbar commented on Jul 28, 2025

    @easbar
    Member

    Yes, GraphHopper does not consider highway=turning_circle so far. See #2761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions