[OSRM-talk] profile.lua car.lua tuning
daniel at mapbox.com
Thu Nov 5 17:31:38 UTC 2015
This is not an easy problem to solve. Overall, car.lua represents a model of the world, our best guess at travel speeds based on OSM road type tags. There are three problems with this:
1) Our guesses might be off
2) OSM tagging is not consistent everywhere
3) OSM might not have enough data granularity to assign different speeds to roads of the same class (i.e. unique speed limits)
Here at Mapbox, we're doing a lot of work internally trying to use real-world measurement data to get the road model more realistic. The results are promising, but unfortunately, it depends on huge boatloads of private data (in-vehicle GPS measurements, traffic data vendors, etc) that we're unlikely going to be able to share. opentraffic.io is working towards open data to do this, it's pretty awesome.
Generally, the car profile works pretty well in places like Germany where OSM tagging is extensive and fairly consistent. In other areas, YMMV. There's probably no real answer other than to keep experimenting with things to suit the OSM tagging in the area you're interested in. As you've observed, small changes can have somewhat chaotic large scale effects.
> On Nov 5, 2015, at 6:35 AM, Michael Chesterton <michael at chesterton.id.au> wrote:
> A bit of a long one.
> I've read a few messages from this list about tuning car.lua,
> not all of them yet, but the ones i have read were different
> problems, my problem is it's too fast. If a trip would take 30
> minutes in real life, osrm might say it takes 20 minutes.
> primarily because of congestion in the city.
> Firstly I can lower the speed of roads, and that works in the city,
> but now trips 30+km outside the city are too slow.
> If I penalise traffic lights more (the default is 2, and I think that
> is 2 seconds based on a comment in another lua file, which to me
> is surprisingly short) osrm starts going to great lengths to avoid them,
> with lots of turns. So I penalise turns more, then i mess up the
> penalise right hand turns more than left hand turns algorithm,
> and the trip api plans a route with more right hand turns than
> with a default profile.lua with one change
> local turn_bias = 0.7
> everything is good except it's to fast in the city.
> If I make one extra change,
> local turn_penalty = 40
> which is too expensive, but i'm just testing, it starts favouring
> right hand turns.
> Can someone make sense of this and offer a fix or a suggestion?
> Maths and computer science algorithms aren't my strong point.
> If I do the turn calculations by hand for a 90 degree turn,
> right hand turns cost 57
> left hand turns cost 28
> further testing
> local turn_penalty = 20
> favours left hand turns, good. then I make one more change
> traffic_signal_penalty = 20
> and it starts favouring right hand turns again :(
> another question, assuming 3 left hand turns around the block cost
> more than 1 right hand turn, does the turn bias affect viaroute, or is
> it mainly only trip?
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org
More information about the OSRM-talk