itinero / routing

The routing core of itinero.
Apache License 2.0
222 stars 71 forks source link

Add extension method to get directed edge id on routerpoint. #141

Closed xivk closed 6 years ago

xivk commented 6 years ago

Add this to RouterPointExtensions:

        /// <summary>
        /// Gets the directed edge id for the routerpoint.
        /// </summary>
        public static long EdgeIdDirected(this RouterPoint point, bool forward = true)
        {
            if (forward)
            {
                return point.EdgeId + 1;
            }
            return -(point.EdgeId + 1);
        }