Skip to content

Improve BikeFlagEncoder #190

Closed
Closed

Description

@karussell

Improve bike and/or bike2, for that create branch improve_bike

  • clean up code, e.g. InstructionList.getWayName, FlagEncoder.get*Type etc belongs somehow more together
  • introduce a preferred routing. Use 3 prefer similar to already existing + we then need a different FastestWeighting for bike
  • make it working that bike prefers tracks or other side roads more as currently too often national ways are chosen -> national ways is not really helpful to decrease priority as lots of streets e.g. in cities are part of such a relation even if they are only tertiary weight
  • some more integration tests
  • bike2: avoid "serpentine shortcut" like here or here => will be fixed in Avoid serpentine shortcuts for bike #201
  • this example should work. Here are the coords.
    Related to Easy way to define route preferences for bike through API and web ui #88
  • racebike: unpaved if tracktype == null? assertEquals("pushing section", getWayTypeFromFlags(osmWay));

Activity

  1. added this to the 0.3 milestone on Apr 29, 2014
  2. karussell commented on Apr 29, 2014

    @karussell
    MemberAuthor

    We already have this and will be recognized in the "preferred" weighting

  3. ratrun commented on May 1, 2014

    @ratrun
    Contributor

    A question to the "introduce a preferred routing" feature:
    Will it be somehow possible to specify dynamically in the search request if I want the fastest route, or the "safest"?

  4. karussell commented on May 1, 2014

    @karussell
    MemberAuthor

    All is possible without CH, but for our hosted solution we use CH.

  5. added a commit that references this issue on May 6, 2014
  6. karussell commented on May 6, 2014

    @karussell
    MemberAuthor

    @ratrun I've pushed the branch https://github.com/graphhopper/graphhopper/tree/improve_bike would you mind to check your tracks?

    Notes:

    • some integration tests do not pass, e.g. please look into krems. Some are hard for an outsider as the one way near the river is bicycle:designated and the other is a bike route relation. So not sure which one is better
    • I'll add some more integration tests for my routes.
    • PriorityWeighting will only used for bike encoders. As for now only those encoders have a getPriority method.
    • I've added a bikeEncoder.collect method with a sorted map (which assigns every priority a 'double weight') which is more powerful than lots of if-then-else statements as one can easier overwrite super class behaviour and other stuff
  7. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    I'm going to push some tunings shortly. Could you please add files/neudrossenfeld.osm.pbf and file files/harsdorf.osm.pbf to git, these are not yet in.

  8. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    Please check commit ratrun@9244185 , which improves the weighting function. Additionally the krems testcase is fixed.

  9. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    Please check commits 884cce6
    and 3620493, which re-activate waytype information for bicycle route instructions.

  10. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    Hmmh, we should really get this line ending thing solved. Normally you don't need to do anything manually as I've set the following in .gitattributes

    * text=auto
    
    # Explicitly declare text files we want to always be normalized and converted
    # to native line endings on checkout.
    *.java text

    Which means: on your machine all is fine and git stores only the correct line ends. Do you have a latest git version? I use 1.7.9.5

    I'll try to integrate the changes manually for now.

  11. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    Regarding the wayType: yes, I forgot to include this in the client. But I would really like to have this separate so that the client can decide what is worth to being displayed. E.g. it could print just a summary saying: xy % of your tour is on sand etc. Also we will introduce more annotations like costs and warnings and attaching all this to the text will make too much.

    What do you think of moving this to the client?

  12. added a commit that references this issue on May 8, 2014
  13. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    Please have a look, all tests pass now (and should also in travis + your machine)

    What I don't understand is why the test for neudrossenfeld and bike2 passes but in real world we see a strange detour ... hmmh even more strange it looks correct if the start is moved a bit upwards. Maybe that is the unpolished elevation data.

  14. 10 remaining items

  15. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    A highway "track" without grade should be assumed unpaved for racing bike i believe, because it is very frustating if you are guided via unpaved ways with a racingbike. I re-checked the tests, please guide me if you think something is wrong.

  16. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    I agree for racing bike but not for normal bike. So this change:

            if ("track".equals(highway) && trackType != null && !"grade1".equals(trackType)
                    || ("track".equals(highway) && trackType == null )
    

    should be better separate (e.g. in the RacingBike class):

    // for bike
            if ("track".equals(highway) && trackType != null && !"grade1".equals(trackType)
    
    // for racing bike
            if ("track".equals(highway) && trackType == null )
    

    ?

  17. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    I don't think that this separation would be good, because from what I see in the mapping praxis it is more likely that a highway track without grade and surface are unpaved. So any actions which might be triggered by detecting unpaved can also be safely taken for trekbiking. This espececially is true for the routing instruction. If I am told that it is unpaved I should look more carefully at a routing instruction in order not to miss a possiby hidden track behind some trees. Or do I miss something? As far as I know currently the bit is only used for routing instrctions, but even if some actions are determined by it, these also should be ok, even if it is only an assumption that this track is most probably unpaved.

  18. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    Ah, ok. But then we don't need the first line. I'll merge your changes soon.

  19. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    You also need the first line IMHO. This line is for the case that the track has tracktype , but other than grade1. In the grade1 case, the marking as unpaved would be wrong.

  20. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    ah, yes, you're right. BTW: there are at least two ugly bugs for calculating the speed in bike2 ...

  21. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    Great that you found someething in bike2. I had a look on the code - it would be great if there would be more comments on what you are calculating there. I gave up to try to understand the formulas after 1 minute or so. I allso believe that bike2 should check if a way is paved or unpaved. It should decrease the upward speed for unpaved more rapidly compared to paved. 12% increase are always hard, but much harder on a bad track.

  22. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    I gave up to try to understand the formulas after 1 minute or so.

    I just decrease the speed for ele increase, and increase the speed for ele decrease. The only problem is that I want a stronger speed-decrease (compared to the speed-increase) for the same elevation difference to simulate loosing energy and avoiding hills.

    (for the reverse speed this has to be the opposite but again keeping in mind that up+down difference)

    12% increase are always hard, but much harder on a bad track.

    Yes, sure, that improvement is for a next version ...

  23. added a commit that references this issue on May 8, 2014
  24. ratrun commented on May 8, 2014

    @ratrun
    Contributor

    Thanks for the bike2 fixes.
    I would love to have the pavement dependent "bike2" routing already in the upcoming version. In mountain terrains, "bike2" is still unusable. Here is one example: http://127.0.0.1:8989/?point=48.019898%2C16.016006&point=47.992736%2C15.958586&vehicle=bike2
    There are two problems here: serpentine shortcut from right at the beginning downwards. It is nice with a mountain bike, but with a trecking bike everyone roll down on the road �. The next upcoming 5��00 hm climb over unpaved tracks on 3.6km upwards will make every touring cyclist prevent using graphhopper ever again.

  25. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    I'll see how hard that is (or would love a pull request or similar :))

  26. karussell commented on May 8, 2014

    @karussell
    MemberAuthor

    Closed via #200, serpentine improvements will go into #201

  27. added a commit that references this issue on May 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions