Hi François,

  There are basically 3 ways to go about this:

    1. If you only have toll-booth nodes, then you can cheat and use the
`result.traffic_lights = true` flag on those nodes, and adjust the traffic
light penalty.  This isn't perfect though, you'll probably want to remove
traffic light tags from elsewhere, and that might mess up some routing,
although I suspect not much.

    2. If you have `toll=yes` on the toll roads, you can simply adjust the
speed/rate down for those roads.  This has the downside that the routing
engine will tend to route you *off* those roads as quickly as possible,
which isn't always what you want.

    3.  You can use the restricted access tags to add a penalty for
*turning onto a toll road* - this will mostly avoid toll roads, and will
not unnecessarily route you off them.  Take a look at how "access=private"
is implemented currently (and how `turn.source_restricted` and
`turn.target_restricted` are used) in the `process_turn` function.  Again,
you may need to sacrifice other access=private/destination features to get
what you need here.

  Also take a look at Chau's work in
https://github.com/Project-OSRM/osrm-backend/pull/4858 - there may be other
ways you can use the `process_turn` function to add penalties for accessing
tolled roads.

daniel

On Wed, Mar 28, 2018 at 9:13 AM, François Lacombe <fl.infosrese...@gmail.com
> wrote:

> Thank you for this input,
>
> Understood the lack of dynamic costing in OSRM. I'll adapat my profile
> Would it be preferable to lower the rate or the speed of specific way I
> want to limit ? Maybe both ?
> I'm not sure to be able to set a rate on a given node isn't it ?
>
> This have to be necessarily relative to rest of my graph
>
> All the best
>
> Francois
>
> *François Lacombe*
>
> fl dot infosreseaux At gmail dot com
> www.infos-reseaux.com
> @InfosReseaux <http://www.twitter.com/InfosReseaux>
>
> 2018-03-28 17:59 GMT+02:00 Daniel Patterson <dan...@mapbox.com>:
>
>> Hey François,
>>
>>   The only way to achieve this with OSRM would be to apply large
>> penalties to barriers/tolls.  You'll have to pick a penalty value that's
>> *just right* - enough that 0 or 1 will be acceptable, but 2 would force the
>> engine to find another route.
>>
>>   Because OSRM doesn't have dynamic costing options, you can't do
>> something like "penalize the first toll with 0, penalize the second toll
>> with 1000" - for that, you'd need to be able to run a more customizable
>> routing algorithm.
>>
>>   We have muttered about implementing A* on the edge-based-graph which
>> would make this possible, but so far, nobody has put the time in to
>> implement it.
>>
>> daniel
>>
>> On Wed, Mar 28, 2018 at 8:31 AM, François Lacombe <
>> fl.infosrese...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Another question I have while I continue to build a routing system
>>> dedicated to industrial networks in parallel of roads we get from osm.
>>>
>>> I'd be interested to get osrm result with a limited amount of particular
>>> ways or nodes in the route.
>>> Something like "Get me from A to B with only 0 or 1 toll barrier on the
>>> route", is this possible ?
>>>
>>> I know the exclude URL parameter to exclude some pre-processed classes
>>> of object, but don't know if we can actually limit them.
>>>
>>> Thanks in advance for any hint, all the best
>>>
>>> François
>>>
>>> _______________________________________________
>>> OSRM-talk mailing list
>>> OSRM-talk@openstreetmap.org
>>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>>
>>>
>>
>> _______________________________________________
>> OSRM-talk mailing list
>> OSRM-talk@openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>
>>
>
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
>
_______________________________________________
OSRM-talk mailing list
OSRM-talk@openstreetmap.org
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to