graphhopper/graphhopper — pull request #55 by khuebner (2013-05-28 14:55:55+00:00)
Title: Initial implementation of turn restriction support

Here's my attempt to let graphhopper support turn costs/restrictions (turn cost = time a turn would cost, turn restriction = infinite turn cost, turn is prohibited).
At the moment only simple turn restrictions will be imported. You can enable turn restriction support by `GraphHopper.enableTurnCosts()` and you need to re-import your osm files. If you want to use turn restrictions together with contraction hierarchies you must decide on preparation time if and which kind of turn cost calculation you want to use. Once the graph has been prepared for contraction hierarchies you cannot switch to another turn cost calculation. This behavior should be familiar since you need to decide on preparation time as well which EdgePropertyEncoder and which WeightCalculation you want to use.

Turn costs are stored in a separate storage. For each turn cost entry the edge id from which the turn goes, the edge id to which the turn goes and the costs of the specific turn is stored. The costs are encoded by TurnCostEncoder, which allows to store separate costs for car and bike in one integer value. When searching for shortest routes only restrictions will be considered, when searching for fastest routes restrictions AND turn costs will be considered. For pedestrians no turn costs or restrictions will be considered.

Feel to try it out. I will add some more details to my implementation when I have a bit more time, maybe tomorrow.