You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for restriction value 'destination' for car #733
The access restriction value destination is not regarded. A high penalty has to be applied when changing from an unrestricted way to a way with destination restriction.
We currently ignore the destination thatswhy the issue. If we introduce this we would either need to introduce an additional priority (like we do e.g. for bikes) or make time estimates slightly incorrect.
IMHO, adding a penalty when switching from non-destination roads, to destination roads would not justify the the effort of implementation.
There are some other options I see right now:
Implement it in the current CarFlagEncoder (probably the most helpful encoder for this right now)
We could modify speed to e.G. 5km/h (However, this would make the estimated travel times incorrect)
We could add a Priority to the CarFlagEncoder (probably not very nice, but the solution would be more correct)
Implement it in the DataFlagEncoder, however this would require us to save the access tags of each highway and analyze them per vehicle (not supported yet)
Right now I guess, that the DataFlagEncoder solution would be the best in terms of future oriented development. The speed "trick" in the CarFlagEncoder would be a fast improvement for the current situation. Maybe we even want to implement both?
We could add a Priority to the CarFlagEncoder (probably not very nice, but the solution would be more correct)
This is the correct solution, but we loose (like we do for bike&foot) that the weight is proportional to the time which is sometimes good for performance reasons, see #240
So I vote to make your two proposed changes and potentially we need to revert the change in CarFlagEncoder e.g. if there are too many long ways with destination.
A strict implementation of this was just feature-requested on Facebook.
The issue with this is, that we don't have enough context to create a wise decision here. Areas tagged with access=destination should be allowed to enter, but only if there is a waypoint in that area or the waypoint is only reachable using this road. AFAIK we cannot model this relation right now?
With 'strict' you mean that uses a priority difference and not via speed?
I would actually think that strict means, to only allow access if this road is needed to reach the destination as in "Anlieger frei".
EDITed to 'stricter'. I think the strict meaning of the rule is "don't go there unless your destination is exactly on this road", and yes, I think we cannot model this right now.
will get worse. What happened here? The Boterstraat (left) and Boeiinksestraat (right) are both "destination"-only roads and distance is only slightly different. When we multiply the weight with 10:
weight=72 * 10 => 720
weight=63 * 10 => 630
an artificial difference is created (90), where the weight of Roosendaalsebaan (39) easily fits in, i.e. Roosendaalsebaan+Boeiinksestraat is then better than Boterstraat, although the way over Boterstraat is in all regards better (shorter & faster). The only "advantage" of the route over the Boeiinksestraat is that the time on a destination-only road is slightly smaller.
Update:
We could introduce some "barrier" edges (edges with high weight) before and after these roads. I.e. you put a penalty not directly on these edges but only if someone wants to go to them or leave them. The only downside could be if you start inside and end inside and for the shortest path you have to leave this "destination area" but this should be probably very rare or non-existent.
Implementation detail: instead of the barrier edges we could use turn costs and then such an avoidance can be created also per-request.
Activity
[-]Restricted Values Destination[/-][+]Support for restriction value 'destination'[/+]boldtrn commentedon Sep 27, 2016
Not sure if this belongs here, but I found a routing issue yesterday, that seems to happen, due to not correctly interpreted
destination:https://graphhopper.com/maps/?point=48.710638%2C9.450173&point=48.712171%2C9.453017&locale=de-DE&vehicle=car&weighting=fastest&elevation=true&use_miles=false&layer=Omniscale
This way should not be used:
http://www.openstreetmap.org/way/362442354#map=19/48.71141/9.45258&layers=ND
karussell commentedon Sep 27, 2016
We currently ignore the destination thatswhy the issue. If we introduce this we would either need to introduce an additional priority (like we do e.g. for bikes) or make time estimates slightly incorrect.
boldtrn commentedon Sep 27, 2016
Wouldn't be this priority exactly the right thing (speaking semantically)?
graphhopper/core/src/main/java/com/graphhopper/routing/util/PriorityCode.java
Line 30 in ea1a8e2
boldtrn commentedon Nov 15, 2016
I am currently looking into this issue.
IMHO, adding a penalty when switching from non-destination roads, to destination roads would not justify the the effort of implementation.
There are some other options I see right now:
Right now I guess, that the DataFlagEncoder solution would be the best in terms of future oriented development. The speed "trick" in the CarFlagEncoder would be a fast improvement for the current situation. Maybe we even want to implement both?
karussell commentedon Nov 15, 2016
Yes, this sounds good
This is the correct solution, but we loose (like we do for bike&foot) that the weight is proportional to the time which is sometimes good for performance reasons, see #240
So I vote to make your two proposed changes and potentially we need to revert the change in CarFlagEncoder e.g. if there are too many long ways with
destination.michaz commentedon Jun 27, 2017
A stricter implementation of this was just feature-requested on Facebook.
In a posting which I'm afraid I cannot link to at the moment because something is broken on Facebook. :-)
The user posted this example:
https://www.openstreetmap.org/directions?engine=graphhopper_car&route=60.63293%2C6.41896%3B60.62968%2C6.41025#map=17/60.63131/6.41460
And would like the result given by OSRM, not that given by us or Mapzen.
karussell commentedon Jun 27, 2017
With 'strict' you mean that uses a priority difference and not via speed?
boldtrn commentedon Jun 27, 2017
The issue with this is, that we don't have enough context to create a wise decision here. Areas tagged with access=destination should be allowed to enter, but only if there is a waypoint in that area or the waypoint is only reachable using this road. AFAIK we cannot model this relation right now?
I would actually think that strict means, to only allow access if this road is needed to reach the destination as in "Anlieger frei".
michaz commentedon Jun 27, 2017
EDITed to 'stricter'. I think the strict meaning of the rule is "don't go there unless your destination is exactly on this road", and yes, I think we cannot model this right now.
michaz commentedon Jun 27, 2017
Just wanted to pass on the interest in this feature.
karussell commentedon Jun 27, 2017
We could model it via priorities IMO (?) I.e. all destination tags get a very bad weighting that will only be used if necessary.
28 remaining items
destination support for car that doesn't modify the speed (#1752)
karussell commentedon Nov 22, 2019
PR #1752 does not fully fix this, especially for short edges. Maybe we use a weight offset, not (only) a factor?
karussell commentedon Jan 31, 2020
We cannot just increase the factor because then situations like this:
https://graphhopper.com/maps/?point=51.528177%2C4.404659&point=51.523235%2C4.4135

will get worse. What happened here? The Boterstraat (left) and Boeiinksestraat (right) are both "destination"-only roads and distance is only slightly different. When we multiply the weight with 10:
an artificial difference is created (90), where the weight of Roosendaalsebaan (39) easily fits in, i.e. Roosendaalsebaan+Boeiinksestraat is then better than Boterstraat, although the way over Boterstraat is in all regards better (shorter & faster). The only "advantage" of the route over the Boeiinksestraat is that the time on a destination-only road is slightly smaller.
Update:
We could introduce some "barrier" edges (edges with high weight) before and after these roads. I.e. you put a penalty not directly on these edges but only if someone wants to go to them or leave them. The only downside could be if you start inside and end inside and for the shortest path you have to leave this "destination area" but this should be probably very rare or non-existent.
Implementation detail: instead of the barrier edges we could use turn costs and then such an avoidance can be created also per-request.
initial working state. fix for #733
scriptable turn statements (#3174)
karussell commentedon Oct 6, 2025
This is now implemented via turn costs.
scriptable turn statements (graphhopper#3174)