/// <summary> /// Tos the feature collection. /// </summary> /// <returns>The feature collection.</returns> /// <param name="routes">Routes.</param> public static FeatureCollection RouteToFeatureCollection(this IRoute routes) { if (routes == null) { throw new ArgumentNullException(nameof(routes)); } FeatureCollection result = null; routes.With(x => x.Segments.Do(segments => { result = new FeatureCollection(segments.Select(segment => segment.SegmentToFeature()).ToList()); })); return(result); }