Skip to content

Allow ignoring seasonal roads #2477

Closed

Description

@PureTryOut

Right now I'm planning for a roadtrip next summer, Graphhopper so far has been by far the best tool for this that I found. This route will take us through Norway which has lots of roads only open in the summer. Since I'm planning for the summer, this isn't a problem but I'm making this route in a season in which those roads are closed, and thus Graphhopper refuses to calculate routes on those roads. It makes it hard to plan months in advance as the route as I make it now will look different when we are actually driving it.

I'd like an option to ignore seasonal restrictions and just route over such a road, no matter what season I'm in.

Activity

  1. karussell commented on Nov 23, 2021

    @karussell
    Member

    Yeah, we should probably lift those restrictions and put this in a special encoded value so that one can still exclude this. Related to #1260.

    Do you have a specific example?

  2. PureTryOut commented on Nov 23, 2021

    @PureTryOut
    Author

    Yes, for example https://graphhopper.com/maps/?point=62.082391%2C7.227845&point=61.939839%2C7.261105&point=62.015004%2C7.647686&locale=en-us&elevation=true&profile=car&use_miles=false&selected_detail=Elevation&layer=Omniscale

    Instead of following the road straight down south from the start, it goes up north instead and drives all the way around. If you however do the same route in the summer, it follows the route down south just fine.

  3. otbutz commented on Nov 29, 2021

    @otbutz
    Contributor

    The biggest question is the detail level we can or want to provide if we add an encoded value for this.

    Conditional access rules can be arbitrarily complex. For your route it's a rather tame example: access:conditional=no @ (Nov-May) but things can get quite messy: motor_vehicle:conditional=delivery @ (Mo-Fr 06:00-11:00,17:00-19:00;Sa 03:30-19:00)

    For time based rules we'd also need to resolve the applicable timezone...

  4. michaz commented on Nov 29, 2021

    @michaz
    Member

    We researched this extensively. Some of us might remember.

    Parsing those rules is messy, but has been done to some level of detail. We could dig out the code. Question is what happens then.

    Do we evaluate the rules at import time, and say, when you import in summer, you get a summer graph? That's easy. (And, apparently, we're doing this, given the OP.)

    Do we evaluate them at query time, so the user specifies a calendar date for which the route is going to be planned? That doesn't work with pre-preparation of any kind -- you would need one profile per day basically, as restrictions overlap, and Landmarks deteriorate surprisingly badly.

    With finer grained restrictions (time of day) it's even worse, also because "real" time-dependent routing (where the clock moves forward as you go) is a different thing altogether.

    We looked into algorithmic possibilities, and there's some code, and it totally works. (And it's easy and correct with plain Dijkstra anyway. Tricky thing is getting it fast.)

    But my conclusion back then was that this is something for hand-built, curated scenarios (for a region, or with two or three hand-picked "seasons"), and we could (in principle, given resources) maintain the tools for this. But supporting this as a world-wide feature in full generality is not practical at the moment. (For us. Our particular codebase and our particular resources.)

    (That was for @otbutz, about following all the rules for the given planning day. I think OP just had a switch in mind where you can say "ignore seasonal restrictions". That's easy of course.)

  5. PureTryOut commented on Nov 29, 2021

    @PureTryOut
    Author

    I think OP just had a switch in mind where you can say "ignore seasonal restrictions".

    Yes I did 😉 Time of day access is of course way more complex and not something I'm personally interested in. I was just thinking of being able to set a date the route is being planned in, and then it'll use the seasonal restrictions of that date. Of course if a route takes e.g. 3 days to complete, that 3rd day might be in another season causing new road restrictions, but that is again more complex than I personally need.

    But a switch to just ignore seasonal restrictions entirely would also work completely fine for me.

  6. otbutz commented on Nov 30, 2021

    @otbutz
    Contributor

    I think OP just had a switch in mind where you can say "ignore seasonal restrictions". That's easy of course.

    We would need a 12bit EV to encode the months as a bitset. Seasons are a regional thing, so we can't use something like Season.WINTER.

  7. karussell commented on Nov 30, 2021

    @karussell
    Member

    We could use a value with a single bit that just says this is a "currently active recurring restriction" (current==at import time):

    1. This would fix this issue without a lot of additional data as it just lifts the restriction
    2. It would be still possible to exclude current recurring (seasonal) restrictions per request or at least show this info via path detail
    3. We would not lift the restriction in case there is a one-time conditional restriction like a road closure
  8. michaz commented on Nov 30, 2021

    @michaz
    Member

    Yeah. Remaining question is where do we do that. Like, do we want this for our own API? Or as a feature for the open source version? If the latter, should it be enabled by default? If so, which features do we enable by default so that the encoded attributes don't stack up?

    Etc.

  9. otbutz commented on Nov 30, 2021

    @otbutz
    Contributor

    I am not very happy with the concept that the determined value is dependent on the import time. This might be perfectly fine for the GH project as the graph is updated frequently. For users who like to plan their routes in advance like OP or others who reimport their graph not that frequently, the routing might be off.

    My proposal: just mark them as seasonal true/false if their conditional access is based on months. Ideally we should use this information for the instructions and to allow them to be used in custom profiles.

  10. karussell commented on Jun 29, 2022

    @karussell
    Member

    I think two pull requests should be enough to get a much better state than now:

    1. feed a seasonal_restricted encoded value instead of blocking the access. I.e. other conditional access restrictions (full date with year) for e.g. constructions should be still done to the car_access etc for now.
    2. feed all conditional restrictions as key+value pair (see EdgeKVStorage: store name and ref tags separately #2598)

    This way clients can easily create a custom model to create the situation as it is now and enable or disable seasonal access.
    And furthermore due to the second pull request there is more information for the user and it is easier to judge for them how dangerous this is.

    We would need a 12bit EV to encode the months as a bitset.

    Storing two bytes in the KVStorage will be soon also possible (see again #2598). But not sure if this is necessary and currently this is not intended and not tried for routing purposes within a Weighting.

    I am not very happy with the concept that the determined value is dependent on the import time.

    We already block roads dependent on the import time and I do not think that introducing this would make this worse.

  11. hungerburg commented on Mar 14, 2024

    @hungerburg

    Will this also work here - https://graphhopper.com/maps/?point=47.169297%2C11.464763&point=47.176746%2C11.503031&profile=bike&layer=TF+Cycle

    The seasonal MTB route is tagged with bicycle:conditional=yes @(Apr-Oct) - but there is also vehicle=no specified -- so to really be useful in the sense of this issue, the conditional would have to be converted to unconditional upfront?

  12. karussell commented on Mar 15, 2024

    @karussell
    Member

    Unfortunately the default kicks in and makes this inaccessible. Will think if we should try to "negate" such a condition.

  13. hungerburg commented on Mar 15, 2024

    @hungerburg
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