This file has been truncated. show original
# How to work with Turn Restrictions
GraphHopper supports [turn restrictions](http://wiki.openstreetmap.org/wiki/Relation:restriction).
Turn restrictions are crucial for correct vehicle navigation and help to avoid forbidden turns.
[Without turn restrictions](https://graphhopper.com/maps/?point=23.1047%2C-82.44319&point=23.10544%2C-82.44316) (the turn is not allowed):
![turn without turn restrictions](./images/turn-restrictions-wrong.png)
[With turn restrictions](https://graphhopper.com/maps/?point=23.1047%2C-82.44319&point=23.10544%2C-82.44316&ch.disable=true):
![turn with turn restrictions](./images/turn-restrictions-correct.png)
Turn restrictions have to be enabled on a vehicle basis. To enable it for one vehicle add
`|turn_costs=true` in the config, for example: `graph.flag_encoders=car|turn_costs=true`.
Or when using the Java API directly you can either create the encoding manager like `EncodingManager.create("car|turn_costs=true")` or
`new EncodingManager.Builder().add(new CarFlagEncoder(5, 5, 1)` where the last parameter of `CarFlagEncoder` represents
the maximum turn costs (a value of 1 means the turn can either be legal or forbidden).
Turn restrictions are not available for every vehicle as they have low relevance
for some vehicles like `foot`.