Skip to content

bike should prefer more footways with bicycle=yes #3014

Closed

Description

@caspg

I noticed that bike profile is preffering tertiary highway instead of footway where bicycle traffic is allowed (bicycle=yes). In my case, it leads to strange route.

Should we lower speed that much if there is bicycle=yes tag in the footway?

         } else if (way.hasTag("bicycle", "designated") || way.hasTag("bicycle", "official") ||
                    way.hasTag("segregated", "yes") || way.hasTag("bicycle", "yes")) {
                // Here we handle the cases where the OSM tagging results in something similar to "highway=cycleway"
                if (way.hasTag("segregated", "yes"))
                    speed = highwaySpeeds.get("cycleway");
                else
                    speed = way.hasTag("bicycle", "yes") ? 10 : highwaySpeeds.get("cycleway");

https://graphhopper.com/maps/?point=54.404198%2C18.624522&point=54.406793%2C18.626314&profile=bike&layer=OpenStreetMap

CleanShot 2024-06-09 at 12 17 29@2x

After changing speed from 10 to "cycleway" speed (18) it routed better:
CleanShot 2024-06-09 at 12 17 09@2x

Activity

  1. ratrun commented on Jun 9, 2024

    @ratrun
    Contributor

    As long as there is no segregated tag I think that the speed penalty of 8km/h is reasonable compared to the speed you can go on the parallel tertiary road. We need to assume pedestrians and therefore one needs to slow down.

  2. caspg commented on Jun 9, 2024

    @caspg
    ContributorAuthor

    I get that but routing in this case is clearly not ideal. Valhalla and Komoot are using footway in my example.

    Can I somehow prioritize that footway with bicycle=yes?

  3. ratrun commented on Jun 9, 2024

    @ratrun
    Contributor

    Can I somehow prioritize that footway with bicycle=yes?

    We are already prioritizing bicycle=yes with the value PREFER, see BikeCommonPriorityParser

    if (way.hasTag("bicycle", "yes") || way.hasTag("bicycle", "permissive"))
    pushingSectionPrio = PREFER;

    But we are prioritizing tertiary also as PREFER, see

    Eventually we should remove this line and additionally change the speed from 10 to 12 or 14. Can you try if this solves your reported example?

  4. caspg commented on Jun 9, 2024

    @caspg
    ContributorAuthor

    @ratrun Removing preferHighwayTags.add("tertiary"); and changing speed to 12 worked!

    Should I submit PR with this change?

  5. ratrun commented on Jun 9, 2024

    @ratrun
    Contributor

    Should I submit PR with this change?

    Yes, I think you should try it. I will support your PR, but we need to convince @karussell. If you do so I recommend to also remove the next line preferHighwayTags.add("tertiary_link"); You need to follow CONTRIBUTING.md. and may add yourself to the CONTRIBUTORS.md file.

  6. matkoniecz commented on Jun 25, 2024

    @matkoniecz
    Contributor

    #3015 is merged, should this issue be closed?

  7. changed the title [-]bike should preffer more footways with bicycle=yes[/-] [+]bike should prefer more footways with bicycle=yes[/+] on Dec 13, 2025
  8. added a commit that references this issue on Dec 13, 2025
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