Skip to content

Prefer cycleway=lane for bike #1500

Open

Description

@karussell

This route should reduce zigzags like this or this. Due to this way.

image

See wiki: https://wiki.openstreetmap.org/wiki/Tag:cycleway=lane

Related to #280 and #1454

Update: we already slightly increase the priority for cycleway=lane and more is probably not a proper solution for other cases as painted cycleways are not really a big advantage. Now, using this branch and turn_costs:{left:6,right:6} already improves this situation a lot:
image

Activity

  1. added
    good first issue
    on Nov 28, 2018
  2. ooxaam commented on Dec 19, 2018

    @ooxaam

    hi , I want to work on this issue. Can you please provide more details on it...

  3. Manishpandey11 commented on Oct 6, 2022

    @Manishpandey11

    Hello ,I want to work on this issue

  4. XxBrezxX commented on Jul 3, 2023

    @XxBrezxX

    Is this issue solved?

  5. otbutz commented on Jul 10, 2023

    @otbutz
    Contributor

    We handle cycleway=lane but it doesn't boost the priority of the way:

    String cycleway = way.getFirstPriorityTag(Arrays.asList("cycleway", "cycleway:left", "cycleway:right"));
    if (Arrays.asList("lane", "shared_lane", "share_busway", "shoulder").contains(cycleway)) {
    weightToPrioMap.put(100d, UNCHANGED.getValue());

  6. ansumandas441 commented on Oct 30, 2023

    @ansumandas441

    Hi, I would like to work on this issue.

  7. otbutz commented on Oct 30, 2023

    @otbutz
    Contributor

    Looks like the priority boost to SLIGHT_PREFER introduced by @ratrun in #2785 isn't enough to fix the route.

    @ansumandas441 feel free to craft a PR 😉

  8. otbutz commented on Oct 30, 2023

    @otbutz
    Contributor

    I haven't looked into it, but maybe this is an unintended side effect of avoiding certain highways(see #2796):

    avoidHighwayTags.put("motorway", REACH_DESTINATION);
    avoidHighwayTags.put("motorway_link", REACH_DESTINATION);
    avoidHighwayTags.put("trunk", REACH_DESTINATION);
    avoidHighwayTags.put("trunk_link", REACH_DESTINATION);
    avoidHighwayTags.put("primary", BAD);
    avoidHighwayTags.put("primary_link", BAD);
    avoidHighwayTags.put("secondary", AVOID);
    avoidHighwayTags.put("secondary_link", AVOID);
    avoidHighwayTags.put("bridleway", AVOID);

    } else if (avoidHighwayTags.containsKey(highway)
    || isValidSpeed(maxSpeed) && maxSpeed >= avoidSpeedLimit && !"track".equals(highway)) {
    PriorityCode priorityCode = avoidHighwayTags.get(highway);
    weightToPrioMap.put(50d, priorityCode == null ? AVOID : priorityCode);

    https://www.openstreetmap.org/way/475214970

  9. changed the title [-]Prefer cycleway:lane for bike[/-] [+]Prefer cycleway=lane for bike[/+] on Mar 3, 2024
  10. ratrun commented on May 4, 2025

    @ratrun
    Contributor

    This issue can be closed. If the bike_tc.json custom model is activated (which is not the case apparently on the online instance), the zig-zags can be avoided.

  11. rawmeat21 commented on Jul 5, 2026

    @rawmeat21

    Is this issue still open? I'd like to work on this.

  12. paulo-aunor commented on Nov 26, 2026

    @paulo-aunor

    Hi, I'm a delivery driver and developer in Waterloo, Ontario. I work on route optimisation for my own nightly delivery rounds, and I audit every leg against OSM way tags — 5,536 legs over 786 km in my last audit.

    I'd like to help with this one, but I want to check first: is #1500 still wanted, or is the bike_tc.json custom model the intended fix now? I read the thread as: the SLIGHT_PREFER boost from #2785 isn't enough on its own, and the zigzag is still there on the public instance.

    If it's still open, I can start with a repro: a Waterloo bike route on a road with cycleway=lane where GraphHopper still zigzags, with the way IDs and the before/after route. I'm new to this codebase (my production work is TypeScript / React Native, not Java), so a repro and a small, pointed fix in BikeCommonPriorityParser is the right first step for me — happy to be pointed at the exact piece a maintainer wants.

    Thanks,
    Paulo Aunor, github.com/paulo-aunor

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

    good first issueimprovementosm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions