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 <[email protected]> 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 <[email protected]> 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
>> [email protected]
>> https://lists.openstreetmap.org/listinfo/osrm-talk
> 

_______________________________________________
OSRM-talk mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/osrm-talk

Reply via email to