routing icon indicating copy to clipboard operation
routing copied to clipboard

Question: Get turn restriction info

Open fromm1990 opened this issue 6 years ago • 1 comments

Hi, i'm unable to figure out how to retrieve information about turn restrictions.

turnrestrictionproblemitinero

Consider the provided graph where it is allowed to go from AB to BC and from BC to BD, however, it is not allowed to go from AB to BD due to a turn restriction.

I have tried to instantiate the Turn class using vertex a, b, d, however, IsRestrictedBy returns false. This is most likely happening because i provide the RestrictionCollection from my RouterDb which is empty. The RouterDb is build from an osm.pbf file, so I assume the turn restrictions are read automatically?

Is it possible to retrieve turn restrictions from the graph? If yes, how is it done?

fromm1990 avatar Nov 20 '18 15:11 fromm1990

You can get restrictions from the routerdb by using this method:

https://github.com/itinero/routing/blob/develop/src/Itinero/RouterDb.cs#L484

The vehicle type there corresponds to the vehicle type used in the profiles:

https://github.com/itinero/routing/blob/develop/src/Itinero/Osm/Vehicles/car.lua#L3

xivk avatar Mar 08 '19 17:03 xivk