< Summary

Class:Itinero.Network.Search.VertexSearch
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Network/Search/VertexSearch.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:38
Line coverage:100% (11 of 11)
Covered branches:4
Total branches:4
Branch coverage:100% (4 of 4)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
SearchVerticesInBox()100%4100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Network/Search/VertexSearch.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using Itinero.Geo;
 4using Itinero.Network.Enumerators.Vertices;
 5using Itinero.Network.Tiles;
 6
 7namespace Itinero.Network.Search;
 8
 9/// <summary>
 10/// Implements vertex searches.
 11/// </summary>
 12internal static class VertexSearch
 13{
 14    /// <summary>
 15    /// Enumerates all vertices in the given bounding box.
 16    /// </summary>
 17    /// <param name="network">The network.</param>
 18    /// <param name="box">The box to enumerate in.</param>
 19    /// <returns>An enumerator with all the vertices and their location.</returns>
 20    internal static IEnumerable<(VertexId vertex, (double longitude, double latitude, float? e) location)>
 21        SearchVerticesInBox(this RoutingNetwork network,
 22            ((double longitude, double latitude, float? e) topLeft, (double longitude, double latitude, float? e)
 23                bottomRight) box)
 3024    {
 3025        var rangeVertices = new TilesVertexEnumerator(network, box.TileRange(network.Zoom));
 26
 8027        while (rangeVertices.MoveNext())
 7028        {
 7029            var location = rangeVertices.Location;
 7030            if (!box.Overlaps(location))
 731            {
 732                continue;
 33            }
 34
 6335            yield return (rangeVertices.Current, location);
 4336        }
 1037    }
 38}

Methods/Properties

SearchVerticesInBox()