[OSRM-talk] Preferring motorways for a route
Emil Tin
emil at tin.dk
Tue May 13 16:59:41 UTC 2014
The lua scripts parses the various OSM tags and returns a single value: the speed. OSRM uses this speed as the only deciding factor (in addition to the length of the ways) when computing routes.
So all you need to do is set the speed high on motorway (say 100 km/h), and low on all other types (say 10 km/h). If you also trunk roads over residential, put trunks at 10 and residentials at 5, etc. You will have to experiment to find settings that provide the type of routes you want.
The only problem you will have is that the travel time will be incorrect. This is an unfortunately consequence of the fact that you cannot specifiy speed and impedance separately (yet). A workaround is to completely ignore the travel time OSRM provides, and calculate it yourself after after a route is returned, as distance/average_car_speed.
-Emil
On 13 May 2014, at 18:14 , Emil Tin <emil at tin.dk> wrote:
>
> it's right here: https://github.com/DennisOSRM/Project-OSRM/blob/develop/profiles/car.lua
>
>
>
> On 13 May 2014, at 17:38 , John Aherne <jjaherne at gmail.com> wrote:
>
>> Thanks for the replies.
>>
>> I'll also take a look at the repo and see if they tell me what I need to do.
>>
>> Although I did find via google a car.lua and could not see any obvious way to prefer motorways.
>>
>> But I'll look again and see what I overlooked.
>>
>> Thanks
>>
>> John Aherne
>>
>> _______________________________________________
>> 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/20140513/9ba3b191/attachment.html>
More information about the OSRM-talk
mailing list