Show / Hide Table of Contents

Class Router

A router implementation encapsulating basic routing functionalities.

Inheritance
System.Object
RouterBase
Router
Inherited Members
RouterBase.ProfileFactorAndSpeedCache
RouterBase.VerifyAllStoppable
RouterBase.TryResolve(IProfileInstance[], Single, Single, Func<RoutingEdge, Boolean>, Single, ResolveSettings)
RouterBase.TryCheckConnectivity(IProfileInstance, RouterPoint, Single, Nullable<Boolean>)
RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint, RouterPoint, RoutingSettings<T>)
RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, Int64, Int64, RoutingSettings<T>)
RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint, Nullable<Boolean>, RouterPoint, Nullable<Boolean>, RoutingSettings<T>)
RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint[], RouterPoint[], RoutingSettings<T>)
RouterBase.TryCalculateWeight<T>(IProfileInstance, WeightHandler<T>, RouterPoint[], RouterPoint[], ISet<Int32>, ISet<Int32>, RoutingSettings<T>)
RouterBase.BuildRoute<T>(IProfileInstance, WeightHandler<T>, RouterPoint, RouterPoint, EdgePath<T>)
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class Router : RouterBase

Constructors

Router(RouterDb)

Creates a new router.

Declaration
public Router(RouterDb db)
Parameters
RouterDb db

Properties

CreateCustomResolver

Gets or sets the delegate to create a custom resolver.

Declaration
public IResolveExtensions.CreateResolver CreateCustomResolver { get; set; }
Property Value
IResolveExtensions.CreateResolver

CustomRouteBuilder

Gets or sets the custom route builder.

Declaration
public IRouteBuilder CustomRouteBuilder { get; set; }
Property Value
IRouteBuilder

Db

Gets the db.

Declaration
public override sealed RouterDb Db { get; }
Property Value
RouterDb

Overrides
RouterBase.Db

ResolverCache

Gets or sets the resolver cache.

Declaration
public IResolverCache ResolverCache { get; set; }
Property Value
IResolverCache

Methods

BuildRoute<T>(IProfileInstance, WeightHandler<T>, RouterPoint, RouterPoint, EdgePath<T>, CancellationToken)

Builds a route.

Declaration
public override sealed Result<Route> BuildRoute<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint source, RouterPoint target, EdgePath<T> path, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance profileInstance

WeightHandler<T> weightHandler

RouterPoint source

RouterPoint target

EdgePath<T> path

CancellationToken cancellationToken

Returns
Result<Route>

Type Parameters
T

Overrides
Itinero.RouterBase.BuildRoute<T>(IProfileInstance, WeightHandler<T>, Itinero.RouterPoint, Itinero.RouterPoint, EdgePath<T>, CancellationToken)

TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint, RouterPoint, RoutingSettings<T>, CancellationToken)

Calculates a route between the two locations.

Declaration
public override sealed Result<EdgePath<T>> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint source, RouterPoint target, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance profileInstance

WeightHandler<T> weightHandler

RouterPoint source

RouterPoint target

RoutingSettings<T> settings

CancellationToken cancellationToken

Returns
Result<EdgePath<T>>

Type Parameters
T

Overrides
Itinero.RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, Itinero.RouterPoint, Itinero.RouterPoint, Itinero.RoutingSettings<T>, CancellationToken)

TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint, Nullable<Boolean>, RouterPoint, Nullable<Boolean>, RoutingSettings<T>, CancellationToken)

Calculates a route between the two directed edges. The route starts in the direction of the edge and ends with an arrive in the direction of the target edge.

Declaration
public override sealed Result<EdgePath<T>> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint source, bool ? sourceForward, RouterPoint target, bool ? targetForward, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance profileInstance

WeightHandler<T> weightHandler

RouterPoint source

System.Nullable<System.Boolean> sourceForward

RouterPoint target

System.Nullable<System.Boolean> targetForward

RoutingSettings<T> settings

CancellationToken cancellationToken

Returns
Result<EdgePath<T>>

Type Parameters
T

Overrides
Itinero.RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, Itinero.RouterPoint, System.Nullable<System.Boolean>, Itinero.RouterPoint, System.Nullable<System.Boolean>, Itinero.RoutingSettings<T>, CancellationToken)

TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, RouterPoint[], RouterPoint[], RoutingSettings<T>, CancellationToken)

Calculates all routes between all sources and all targets.

Declaration
public override sealed Result<EdgePath<T>[][]> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint[] sources, RouterPoint[] targets, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance profileInstance

WeightHandler<T> weightHandler

RouterPoint[] sources

RouterPoint[] targets

RoutingSettings<T> settings

CancellationToken cancellationToken

Returns
Result<EdgePath<T>[][]>

Type Parameters
T

Overrides
Itinero.RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, Itinero.RouterPoint[], Itinero.RouterPoint[], Itinero.RoutingSettings<T>, CancellationToken)

TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, Int64, Int64, RoutingSettings<T>, CancellationToken)

Calculates a route between the two directed edges. The route starts in the direction of the edge and ends with an arrive in the direction of the target edge.

Declaration
public override sealed Result<EdgePath<T>> TryCalculateRaw<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, long sourceDirectedEdge, long targetDirectedEdge, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance profileInstance

WeightHandler<T> weightHandler

System.Int64 sourceDirectedEdge

System.Int64 targetDirectedEdge

RoutingSettings<T> settings

CancellationToken cancellationToken

Returns
Result<EdgePath<T>>

Type Parameters
T

Overrides
Itinero.RouterBase.TryCalculateRaw<T>(IProfileInstance, WeightHandler<T>, System.Int64, System.Int64, Itinero.RoutingSettings<T>, CancellationToken)

TryCalculateWeight<T>(IProfileInstance, WeightHandler<T>, RouterPoint[], RouterPoint[], ISet<Int32>, ISet<Int32>, RoutingSettings<T>, CancellationToken)

Calculates all routes between all sources and all targets.

Declaration
public override sealed Result<T[][]> TryCalculateWeight<T>(IProfileInstance profileInstance, WeightHandler<T> weightHandler, RouterPoint[] sources, RouterPoint[] targets, ISet<int> invalidSources, ISet<int> invalidTargets, RoutingSettings<T> settings, CancellationToken cancellationToken)where T : struct
Parameters
IProfileInstance profileInstance

WeightHandler<T> weightHandler

RouterPoint[] sources

RouterPoint[] targets

ISet<System.Int32> invalidSources

ISet<System.Int32> invalidTargets

RoutingSettings<T> settings

CancellationToken cancellationToken

Returns
Result<T[][]>

Type Parameters
T

Overrides
Itinero.RouterBase.TryCalculateWeight<T>(IProfileInstance, WeightHandler<T>, Itinero.RouterPoint[], Itinero.RouterPoint[], ISet<System.Int32>, ISet<System.Int32>, Itinero.RoutingSettings<T>, CancellationToken)

TryCheckConnectivity(IProfileInstance, RouterPoint, Single, Nullable<Boolean>, CancellationToken)

Checks if the given point is connected to the rest of the network. Use this to detect points on routing islands.

Declaration
public override sealed Result<bool> TryCheckConnectivity(IProfileInstance profileInstance, RouterPoint point, float radiusInMeter, bool ? forward, CancellationToken cancellationToken)
Parameters
IProfileInstance profileInstance

RouterPoint point

System.Single radiusInMeter

The radius metric, that's always a distance in meters.

System.Nullable<System.Boolean> forward

CancellationToken cancellationToken

Returns
Result<System.Boolean>

Overrides
RouterBase.TryCheckConnectivity(IProfileInstance, RouterPoint, Single, Nullable<Boolean>, CancellationToken)

TryResolve(IProfileInstance[], Single, Single, Func<RoutingEdge, Boolean>, Single, ResolveSettings, CancellationToken)

Searches for the closest point on the routing network that's routable for the given profiles.

Declaration
public override sealed Result<RouterPoint> TryResolve(IProfileInstance[] profileInstances, float latitude, float longitude, Func<RoutingEdge, bool> isBetter, float maxSearchDistance, ResolveSettings settings, CancellationToken cancellationToken)
Parameters
IProfileInstance[] profileInstances

System.Single latitude

System.Single longitude

Func<RoutingEdge, System.Boolean> isBetter

System.Single maxSearchDistance

ResolveSettings settings

CancellationToken cancellationToken

Returns
Result<RouterPoint>

Overrides
RouterBase.TryResolve(IProfileInstance[], Single, Single, Func<RoutingEdge, Boolean>, Single, ResolveSettings, CancellationToken)
Back to top Built by Itinero, MIT licensed.