< Summary

Class:Itinero.Geo.Elevation.RouteExtensions
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Geo/Elevation/RouteExtensions.cs
Covered lines:6
Uncovered lines:0
Coverable lines:6
Total lines:27
Line coverage:100% (6 of 6)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
AddElevation(...)100%2100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Geo/Elevation/RouteExtensions.cs

#LineLine coverage
 1using Itinero.Routes;
 2
 3namespace Itinero.Geo.Elevation;
 4
 5/// <summary>
 6/// Extensions for the route object related to elevation.
 7/// </summary>
 8public static class RouteExtensions
 9{
 10    /// <summary>
 11    /// Adds elevation to the route.
 12    /// </summary>
 13    /// <param name="route">The route.</param>
 14    /// <param name="elevationHandler">The elevation handler, if null, the default will be used.</param>
 15    /// <remarks>
 16    /// This only adds elevation if an elevation handler was registered. It doesn't overwrite any elevation data already
 17    /// </remarks>
 18    public static void AddElevation(this Route route, IElevationHandler? elevationHandler = null)
 219    {
 820        for (var s = 0; s < route.Shape.Count; s++)
 221        {
 222            route.Shape[s] = route.Shape[s].AddElevation(elevationHandler: elevationHandler);
 223        }
 24
 25        // TODO: add branches when implemented.
 226    }
 27}

Methods/Properties

AddElevation(...)