< Summary

Class:Itinero.Routing.Isochrones.IsochroneRing
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Routing/Isochrones/Isochrone.cs
Covered lines:7
Uncovered lines:0
Coverable lines:7
Total lines:88
Line coverage:100% (7 of 7)
Covered branches:0
Total branches:0
Tag:284_38118444584

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%1100%
get_Coordinates()100%1100%
get_SignedArea()100%1100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Routing/Isochrones/Isochrone.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace Itinero.Routing.Isochrones;
 4
 5/// <summary>
 6/// A closed ring of coordinates, first point not repeated as the last.
 7/// </summary>
 8public sealed class IsochroneRing
 9{
 17110    internal IsochroneRing(List<(double longitude, double latitude)> coordinates, double signedArea)
 17111    {
 17112        this.Coordinates = coordinates;
 17113        this.SignedArea = signedArea;
 17114    }
 15
 16016    public IReadOnlyList<(double longitude, double latitude)> Coordinates { get; }
 17
 18    /// <summary>
 19    /// Twice the signed area in square degrees. Positive is counter-clockwise.
 20    /// </summary>
 21    /// <remarks>
 22    /// Degrees, so it compares rings at one latitude and is not an area measurement.
 23    /// </remarks>
 43924    internal double SignedArea { get; }
 25}
 26
 27/// <summary>
 28/// One reachable area: an outer ring, and holes for anything inside it the search never reached.
 29/// </summary>
 30/// <remarks>
 31/// A hole is a real answer, not an artefact — a lake, or a block whose streets are all one-way
 32/// outward. Bands can have several areas when the network is disconnected at this cost.
 33/// </remarks>
 34public sealed class IsochronePolygon
 35{
 36    internal IsochronePolygon(IsochroneRing outer, List<IsochroneRing> holes)
 37    {
 38        this.Outer = outer;
 39        this.Holes = holes;
 40    }
 41
 42    public IsochroneRing Outer { get; }
 43
 44    public IReadOnlyList<IsochroneRing> Holes { get; }
 45}
 46
 47/// <summary>
 48/// Everything reachable from the origin at no more than <see cref="Cost"/>.
 49/// </summary>
 50public sealed class IsochroneBand
 51{
 52    internal IsochroneBand(double cost, List<IsochronePolygon> polygons)
 53    {
 54        this.Cost = cost;
 55        this.Polygons = polygons;
 56    }
 57
 58    /// <summary>The cost bound this band was cut at, in the cost function's own units.</summary>
 59    public double Cost { get; }
 60
 61    public IReadOnlyList<IsochronePolygon> Polygons { get; }
 62}
 63
 64/// <summary>
 65/// The bands, innermost first, and what the search behind them cost.
 66/// </summary>
 67public sealed class Isochrone
 68{
 69    internal Isochrone(List<IsochroneBand> bands, IsochroneDiagnostics diagnostics)
 70    {
 71        this.Bands = bands;
 72        this.Diagnostics = diagnostics;
 73    }
 74
 75    public IReadOnlyList<IsochroneBand> Bands { get; }
 76
 77    public IsochroneDiagnostics Diagnostics { get; }
 78}
 79
 80/// <param name="Settled">States the search settled, including those past the outermost band.</param>
 81/// <param name="Reached">Vertices given a cost.</param>
 82/// <param name="Cells">Grid cells the cost surface covers.</param>
 83/// <param name="CellSizeMeters">Resolution actually used, which may be coarser than asked for.</param>
 84public readonly record struct IsochroneDiagnostics(
 85    long Settled,
 86    int Reached,
 87    long Cells,
 88    double CellSizeMeters);