DennisOSRM/Project-OSRM — pull request #240 by emiltin (2012-05-02 18:27:41+00:00)
Title: turn penalties

this commit implements a simple turn penalty formula that squares the turn angle (where straight ahead is 0, uturn is 180), scales it and multiplies it with the "turnPenalty" speedprofile setting. in addition you can set "turnBias" to make left turns more expensive than right turns (or the other way around). 1 (or leaving it out) means no bias.

this seems to work quite well. it really helps to smooth out routes a bit - you avoid overly wriggly routes with a minimal increase in length.

"turnPenalty" or "turnBias" can be left out in the speedprofile in case you don't want to incur turn penalties.