[OSRM-talk] Limit particular points in a route at runtime

Daniel Hofmann hofmann at mapbox.com
Thu Mar 29 11:27:35 UTC 2018


> I'll ask for about 20 alternatives and filter them according to my rules
in post processing, this is the best option currently

Even if you request `alternatives=20` you won't get 20 alternatives because
most of the times (if not always) there aren't 20 reasonable alternatives.

If you want to change what it means for an alternative to be reasonable you
need to tweak:

https://github.com/Project-OSRM/osrm-backend/blob/0d9f18fe1f8cc12e77bb652bfde3372c28bfd845/src/engine/routing_algorithms/alternative_path_mld.cpp#L37-L51

Best,
Daniel J H

On Thu, Mar 29, 2018 at 9:44 AM, François Lacombe <fl.infosreseaux at gmail.com
> wrote:

> Hi Daniel,
>
> I'd choose the first solution, with trafic light penalty.
>
> Remaining issue is the cost of one single point shoud adapt to desired
> route versus rejected ones.
> This is not an absolute value, but relative
> That's why dynamic costing would be really interesting in OSRM.
>
> I'll ask for about 20 alternatives and filter them according to my rules
> in post processing, this is the best option currently
>
>
> François
>
>
> *François Lacombe*
>
> fl dot infosreseaux At gmail dot com
> www.infos-reseaux.com
> @InfosReseaux <http://www.twitter.com/InfosReseaux>
>
> 2018-03-28 19:07 GMT+02:00 Daniel Patterson <daniel at mapbox.com>:
>
>> 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.infosreseaux at 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 <daniel at 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.infosreseaux at 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 at openstreetmap.org
>>>>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> OSRM-talk mailing list
>>>> OSRM-talk at openstreetmap.org
>>>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>>>
>>>>
>>>
>>> _______________________________________________
>>> OSRM-talk mailing list
>>> OSRM-talk at openstreetmap.org
>>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>>
>>>
>>
>> _______________________________________________
>> OSRM-talk mailing list
>> OSRM-talk at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/osrm-talk
>>
>>
>
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20180329/0716af89/attachment.html>


More information about the OSRM-talk mailing list