| | | 1 | | using System.Collections; |
| | | 2 | | using System.Linq; |
| | | 3 | | using Itinero.Routes; |
| | | 4 | | using NetTopologySuite.Features; |
| | | 5 | | using NetTopologySuite.Geometries; |
| | | 6 | | |
| | | 7 | | namespace Itinero.Geo; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Contains extension methods for the route object. |
| | | 11 | | /// </summary> |
| | | 12 | | public static class RouteExtensions |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Converts the given route to a line string. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <param name="route">The route.</param> |
| | | 18 | | /// <returns>The linestring.</returns> |
| | | 19 | | public static LineString ToLineString(this Route route) |
| | 0 | 20 | | { |
| | 0 | 21 | | return new LineString(route.Shape.Select(x => new Coordinate(x.longitude, x.latitude)).ToArray()); |
| | 0 | 22 | | } |
| | | 23 | | |
| | | 24 | | } |