Skip to content

Problem with bicycle=yes and vehicle=destination #1831

Closed

Description

@ratrun

Following route https://graphhopper.com/maps/?point=48.179737%2C16.115484&point=48.175072%2C16.122608&locale=de&vehicle=bike&weighting=fastest&elevation=true&use_miles=false&layer=Omniscale results in a big unexpected de-tour. I found out that one needs to remove the tags vehicle=destination and motor_vehicle=destination from way https://www.openstreetmap.org/way/155156339 in order to get an expected result.
To me it looks to be a problem outside of the bicycle specific routing because I couldn't create a bicycle specific test to nail down this problem.

Activity

  1. karussell commented on Dec 19, 2019

    @karussell
    Member

    Strange. Especially since #1272 is not yet merged. And your request seems to support my claim that we should not support this tag for bike and foot.

    So surely we need to investigate what is wrong here.

  2. boldtrn commented on Jan 16, 2020

    @boldtrn
    Member

    Isn't this the expected behavior? If an edge is tagged with vehicle=destination, the bike flag encoder will pick this up and set the RoadAccess to destination (vehicle is added to restrictions for bikes). RoadAccess is a required encoded value, so it's always used, right? The fastest weighting will add the edge penalty for destination access.

    As mentioned in #1272, we could think about not using the destination tag at all for bike and foot.

  3. karussell commented on Jan 16, 2020

    @karussell
    Member

    If an edge is tagged with vehicle=destination, the bike flag encoder will pick this up and set the RoadAccess to destination (vehicle is added to restrictions for bikes).

    Thanks, indeed, this is the reason.

    Having such an example still helps to see that even an explicit bicycle=destination should be ignored here.

    I again parsed some forum entries and many mapper believe that a sign which shows

    "bicycles only OR destination only" means highway=cycleway and vehicle=destination

    which is IMO a tagging mistake and instead highway=cycleway and motor_vehicle=destination should be used. Discussed e.g. here (German).

    In general there are several mistakes where vehicle=x is used instead of motor_vehicle=x, but there does not seem to be even a sign that really means "vehicle=destination (i.e. with foot and bike)".

    And as this makes bike+foot routes worse like here, we should consider closing #1272.

    Maybe even removing the destination restriction for the bike + foot routing in general that would fix this issue here. Thoughts @ratrun ?

  4. ratrun commented on Jan 16, 2020

    @ratrun
    ContributorAuthor

    If an edge is tagged with vehicle=destination, the bike flag encoder will pick this up and set the RoadAccess to destination (vehicle is added to restrictions for bikes).

    I guess here you mean this line of code in BikeCommonFlagEncoder:
    restrictions.addAll(Arrays.asList("bicycle", "vehicle", "access"));

    I tried to remove the "vehicle" from this list, recompiled and tested the example above, but this does not help. This explaination also does not explain that I need to remove both tags vehicle=destination and motor_vehicle=destination in order to fix the issue.

  5. boldtrn commented on Jan 17, 2020

    @boldtrn
    Member

    Yes indeed, there are quite a lot of tagging mistakes in that area.

    but there does not seem to be even a sign that really means "vehicle=destination (i.e. with foot and bike)".

    AFAIK in Germany, the sign is the red circle, with white background and an attached sign "Anlieger frei", see for example this file: https://commons.wikimedia.org/wiki/File:Wuppertal_Carnaper_Stra%C3%9Fe_2018_039.jpg

    This should be vehicle=destination, including bikes. I think pedestrians are still allowed to pass. I am not sure if there are other signs.

    I tried to remove the "vehicle" from this list, recompiled and tested the example above

    Did you also reimported the graph?

  6. ratrun commented on Jan 17, 2020

    @ratrun
    ContributorAuthor

    Did you also reimported the graph?

    Yes I did. I do not see any tagging error as the tagging is according to this signs: http://osmtools.de/traffic_signs/?signs=250,1020-12 which means "Fahrrad und Anlieger frei", therefore the way also has a tag bicycle=yes.

  7. boldtrn commented on Jan 18, 2020

    @boldtrn
    Member

    That's strange, maybe we should debug what happens here.

  8. ratrun commented on Jan 18, 2020

    @ratrun
    ContributorAuthor

    I would ask for debugging. How ever this can be done in this case. I don't know it.
    What I tried is playing around with this test:

            way.setTag("highway", "service");
            way.setTag("surface", "asphalt");
            way.setTag("bicycle", "yes");
            way.setTag("vehicle", "destination");
            //way.setTag("motor_vehicle", "destination");
            assertEquals(18, encoder.getSpeed(way));
            assertPriority(PREFER.getValue(), way);
            assertTrue(encoder.getAccess(way).isWay());
    

    This test passes irrespsective if vehicle=destination and motot_vehicle=destination is included or not.

  9. karussell commented on Feb 6, 2020

    @karussell
    Member

    Yeah, this seems to be a bug. Here is another example that uses motor_vehicle:destination and should not affect bike.

    Update: maybe also here: https://discuss.graphhopper.com/t/5185

  10. ratrun commented on Feb 25, 2020

    @ratrun
    ContributorAuthor

    Maybe I now found the reason:

    if (roadAccessEnc != null && edgeState.get(roadAccessEnc) == RoadAccess.DESTINATION)
    time *= roadAccessPenalty;

    If I comment out these two lines then the segment tagged as motor_vehicle=destination is taken. This code part is not aware of the bicycle=yes tag

  11. karussell commented on Feb 25, 2020

    @karussell
    Member

    Ah, thanks, indeed this is wrong!!

  12. added this to the 1.0 milestone on Feb 25, 2020
  13. karussell commented on Feb 27, 2020

    @karussell
    Member

    Thanks again @ratrun for the investigation! The fix will hopefully be deployed next week.

  14. karussell commented on Mar 16, 2020

    @karussell
    Member

    Took a bit longer but is now deployed :)

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions