< Summary

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

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
ToCoordinateTuple(...)100%10%
DistanceEstimateInMeter(...)100%10%

File(s)

/home/runner/work/routing2/routing2/src/Itinero.Geo/CoordinateExtensions.cs

#LineLine coverage
 1using NetTopologySuite.Geometries;
 2
 3namespace Itinero.Geo;
 4
 5/// <summary>
 6/// Extension methods related to coordinates.
 7/// </summary>
 8public static class CoordinateExtensions
 9{
 10    /// <summary>
 11    /// Converts the coordinate to an Itinero coordinate tuple.
 12    /// </summary>
 13    /// <param name="coordinate">The coordinate.</param>
 14    /// <returns>A coordinate tuple.</returns>
 15    public static (double longitude, double latitude, float? e) ToCoordinateTuple(this Coordinate coordinate)
 016    {
 017        return (coordinate.X, coordinate.Y, null);
 018    }
 19
 20    /// <summary>
 21    /// Returns an estimate of the distance between the two given coordinates.
 22    /// </summary>
 23    /// <param name="coordinate">The first coordinate.</param>
 24    /// <param name="other">The second coordinate.</param>
 25    /// <remarks>Accuracy decreases with distance.</remarks>
 26    public static double DistanceEstimateInMeter(this Coordinate coordinate, Coordinate other)
 027    {
 028        return coordinate.ToCoordinateTuple().DistanceEstimateInMeter(other.ToCoordinateTuple());
 029    }
 30}