< Summary

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

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
AsStream(...)100%1100%
AsStream(...)100%1100%
AsStream(...)100%10%
AsStream(...)100%10%

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using Itinero.Network;
 4using NetTopologySuite.Features;
 5
 6namespace Itinero.Geo;
 7
 8public static class RoutingNetworkExtensions
 9{
 10    /// <summary>
 11    /// Converts the RoutingNetwork into a stream of GeoFeatures
 12    /// </summary>
 13    /// <param name="routerDb">The network to convert</param>
 14    public static IEnumerable<IFeature> AsStream(this RouterDb routerDb)
 415    {
 416        return routerDb.Latest.AsStream();
 417    }
 18
 19    /// <summary>
 20    /// Converts the RoutingNetwork into a stream of GeoFeatures
 21    /// </summary>
 22    /// <param name="network">The network to convert</param>
 23    public static IEnumerable<IFeature> AsStream(this RoutingNetwork network)
 424    {
 425        return new RoutingNetworkStream(network, null);
 426    }
 27
 28
 29    /// <summary>
 30    /// Converts the RoutingNetwork into a stream of GeoFeatures
 31    /// </summary>
 32    /// <param name="routerDb">The network to convert</param>
 33    /// <param name="preprocessAttributes">The function which preprocesses the attributes on the edges</param>
 34    public static IEnumerable<IFeature> AsStream(this RouterDb routerDb,
 35        Func<IEnumerable<(string key, string value)>, IEnumerable<(string key, string value)>> preprocessAttributes)
 036    {
 037        return routerDb.Latest.AsStream(preprocessAttributes);
 038    }
 39
 40    /// <summary>
 41    /// Converts the RoutingNetwork into a stream of GeoFeatures
 42    /// </summary>
 43    /// <param name="network">The network to convert</param>
 44    /// <param name="preprocessAttributes">The function which preprocesses the attributes on the edges</param>
 45    public static IEnumerable<IFeature> AsStream(this RoutingNetwork network,
 46        Func<IEnumerable<(string key, string value)>, IEnumerable<(string key, string value)>> preprocessAttributes)
 047    {
 048        return new RoutingNetworkStream(network, preprocessAttributes);
 049    }
 50}