Class RouterPointExtensions
Contains extension methods for the routerpoint.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public static class RouterPointExtensions
Methods
Angle(RouterPoint, RoutingNetwork, Single)
Calculates the angle in degress at the given routerpoint over a given distance.
Declaration
public static float ? Angle(this RouterPoint point, RoutingNetwork network, float distance = 100F)
Parameters
RouterPoint
point
The router point. |
RoutingNetwork
network
The routing network. |
System.Single
distance
The distance to average over. |
Returns
System.Nullable<System.Single>
The angle relative to the meridians. |
CreateRouterPoint(RouterDb, UInt32, UInt16)
Creates a new router point.
Declaration
public static RouterPoint CreateRouterPoint(this RouterDb routerDb, uint edgeId, ushort offset)
Parameters
RouterDb
routerDb
|
System.UInt32
edgeId
|
System.UInt16
offset
|
Returns
RouterPoint
|
CreateRouterPointForEdge(RouterDb, RoutingEdge, Boolean, Boolean)
Creates a router point for the given edge.
Declaration
public static RouterPoint CreateRouterPointForEdge(this RouterDb routerDb, RoutingEdge edge, bool edgeIsForward, bool atStart)
Parameters
RouterDb
routerDb
|
RoutingEdge
edge
|
System.Boolean
edgeIsForward
|
System.Boolean
atStart
|
Returns
RouterPoint
|
CreateRouterPointForEdge(RouterDb, Int64, Boolean)
Creates a router point for the given edge.
Declaration
public static RouterPoint CreateRouterPointForEdge(this RouterDb routerDb, long directedEdgeId, bool atStart)
Parameters
RouterDb
routerDb
|
System.Int64
directedEdgeId
|
System.Boolean
atStart
|
Returns
RouterPoint
|
CreateRouterPointForVertex(GeometricGraph, UInt32, Func<GeometricEdge, Boolean>)
Creates a router point for the given vertex.
Declaration
public static RouterPoint CreateRouterPointForVertex(this GeometricGraph graph, uint vertex, Func<GeometricEdge, bool> isAcceptable)
Parameters
GeometricGraph
graph
|
System.UInt32
vertex
|
Func<GeometricEdge, System.Boolean>
isAcceptable
|
Returns
RouterPoint
|
CreateRouterPointForVertex(GeometricGraph, UInt32, UInt32)
Creates a router point for the given vertex.
Declaration
public static RouterPoint CreateRouterPointForVertex(this GeometricGraph graph, uint vertex, uint neighbour)
Parameters
GeometricGraph
graph
|
System.UInt32
vertex
|
System.UInt32
neighbour
|
Returns
RouterPoint
|
CreateRouterPointForVertex(RouterDb, UInt32, Profile[])
Creates a router point for the given vertex.
Declaration
public static RouterPoint CreateRouterPointForVertex(this RouterDb routerDb, uint vertex, params Profile[] profile)
Parameters
RouterDb
routerDb
|
System.UInt32
vertex
|
Profile[]
profile
|
Returns
RouterPoint
|
CreateRouterPointForVertex(RoutingNetwork, UInt32)
Creates a router point for the given vertex.
Declaration
public static RouterPoint CreateRouterPointForVertex(this RoutingNetwork graph, uint vertex)
Parameters
RoutingNetwork
graph
|
System.UInt32
vertex
|
Returns
RouterPoint
|
CreateRouterPointForVertex(RoutingNetwork, UInt32, UInt32)
Creates a router point for the given vertex.
Declaration
public static RouterPoint CreateRouterPointForVertex(this RoutingNetwork graph, uint vertex, uint neighbour)
Parameters
RoutingNetwork
graph
|
System.UInt32
vertex
|
System.UInt32
neighbour
|
Returns
RouterPoint
|
DirectionFromAngle(RouterPoint, RouterDb, Nullable<Single>, Single)
Determines the direction from the given angle, true meaning forward relative to the edge in the routerpoint, false backwards.
Declaration
public static bool ? DirectionFromAngle(this RouterPoint routerPoint, RouterDb routerDb, float ? angle, float diffLimit = 90F)
Parameters
RouterPoint
routerPoint
The router point. |
RouterDb
routerDb
The router db. |
System.Nullable<System.Single>
angle
The angle in degrees relative to the longitudinal lines. |
System.Single
diffLimit
The diff limit when the angle is smaller than this we consider it the same direction. |
Returns
System.Nullable<System.Boolean>
True when forward, false when backward, null when direction couldn't be determined (outside of difflimit for example). |
DistanceTo(RouterPoint, RouterDb, RouterPoint)
Calculates the distance to one of the vertices on the edge this router point is on.
Declaration
public static float DistanceTo(this RouterPoint point, RouterDb routerDb, RouterPoint target)
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
RouterPoint
target
|
Returns
System.Single
|
DistanceTo(RouterPoint, RouterDb, UInt32)
Calculates the distance to one of the vertices on the edge this router point is on.
Declaration
public static float DistanceTo(this RouterPoint point, RouterDb routerDb, uint vertex)
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
System.UInt32
vertex
|
Returns
System.Single
|
EdgeIdDirected(RouterPoint, Boolean)
Gets the directed edge id for the routerpoint.
Declaration
public static long EdgeIdDirected(this RouterPoint point, bool forward = true)
Parameters
RouterPoint
point
|
System.Boolean
forward
|
Returns
System.Int64
|
EdgePathTo<T>(RouterPoint, RouterDb, WeightHandler<T>, RouterPoint)
Calculates the edge path between this router point and the given router point.
Declaration
public static EdgePath<T> EdgePathTo<T>(this RouterPoint point, RouterDb db, WeightHandler<T> weightHandler, RouterPoint target)where T : struct
Parameters
RouterPoint
point
|
RouterDb
db
|
WeightHandler<T>
weightHandler
|
RouterPoint
target
|
Returns
EdgePath<T>
|
Type Parameters
T
|
EdgePathTo<T>(RouterPoint, RouterDb, WeightHandler<T>, RouterPoint, Boolean)
Calculates the edge path between this router point and the given router point.
Declaration
public static EdgePath<T> EdgePathTo<T>(this RouterPoint point, RouterDb db, WeightHandler<T> weightHandler, RouterPoint target, bool backward = false)where T : struct
Parameters
RouterPoint
point
The source point. |
RouterDb
db
The router db. |
WeightHandler<T>
weightHandler
The weight handler. |
RouterPoint
target
The target point. |
System.Boolean
backward
Forces the direction on the edge to travel in. |
Returns
EdgePath<T>
|
Type Parameters
T
|
EdgePathTo<T>(RouterPoint, RouterDb, WeightHandler<T>, Nullable<Boolean>, RouterPoint, Nullable<Boolean>)
Calculates the edge path between this router point and the given router point.
Declaration
public static EdgePath<T> EdgePathTo<T>(this RouterPoint point, RouterDb db, WeightHandler<T> weightHandler, bool ? sourceForward, RouterPoint target, bool ? targetForward)where T : struct
Parameters
RouterPoint
point
The source point. |
RouterDb
db
The router db. |
WeightHandler<T>
weightHandler
The weight handler. |
System.Nullable<System.Boolean>
sourceForward
The source forward flag, true if forward, false if backward, null if don't care. |
RouterPoint
target
The target point. |
System.Nullable<System.Boolean>
targetForward
The target forward flag, true if forward, false if backward, null if don't care. |
Returns
EdgePath<T>
|
Type Parameters
T
|
EdgePathTo<T>(RouterPoint, RouterDb, WeightHandler<T>, UInt32, Boolean)
Calculates the edge path between this router point and one of it's neighbours.
Declaration
public static EdgePath<T> EdgePathTo<T>(this RouterPoint point, RouterDb db, WeightHandler<T> weightHandler, uint neighbour, bool backward = false)where T : struct
Parameters
RouterPoint
point
|
RouterDb
db
|
WeightHandler<T>
weightHandler
|
System.UInt32
neighbour
|
System.Boolean
backward
|
Returns
EdgePath<T>
|
Type Parameters
T
|
IsIdenticalTo(RouterPoint, RouterPoint)
Returns true if the given point is identical.
Declaration
public static bool IsIdenticalTo(this RouterPoint point, RouterPoint other)
Parameters
RouterPoint
point
|
RouterPoint
other
|
Returns
System.Boolean
|
IsVertex(RouterPoint)
Returns true if the router point matches exactly with the given vertex.
Declaration
public static bool IsVertex(this RouterPoint point)
Parameters
RouterPoint
point
|
Returns
System.Boolean
|
IsVertex(RouterPoint, RouterDb, UInt32)
Returns true if the router point matches exactly with the given vertex.
Declaration
public static bool IsVertex(this RouterPoint point, RouterDb router, uint vertex)
Parameters
RouterPoint
point
|
RouterDb
router
|
System.UInt32
vertex
|
Returns
System.Boolean
|
Location(RouterPoint)
Returns the location.
Declaration
public static Coordinate Location(this RouterPoint point)
Parameters
RouterPoint
point
|
Returns
Coordinate
|
LocationOnNetwork(RouterPoint, RouterDb)
Returns the location on the network.
Declaration
public static Coordinate LocationOnNetwork(this RouterPoint point, RouterDb db)
Parameters
RouterPoint
point
|
RouterDb
db
|
Returns
Coordinate
|
ShapePointsTo(RouterPoint, RouterDb, RouterPoint)
Calculates the shape points along the way from this router point to another routerpoint on the same edge.
Declaration
public static List<Coordinate> ShapePointsTo(this RouterPoint point, RouterDb routerDb, RouterPoint other)
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
RouterPoint
other
|
Returns
List<Coordinate>
|
ShapePointsTo(RouterPoint, RouterDb, UInt32)
Calculates the shape points along the way from this router point to one of it's vertices.
Declaration
public static List<Coordinate> ShapePointsTo(this RouterPoint point, RouterDb routerDb, uint vertex)
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
System.UInt32
vertex
|
Returns
List<Coordinate>
|
ToEdgePaths<T>(RouterPoint, RouterDb, WeightHandler<T>, Boolean)
Converts the router point to paths leading to the closest 2 vertices.
Declaration
public static EdgePath<T>[] ToEdgePaths<T>(this RouterPoint point, RouterDb routerDb, WeightHandler<T> weightHandler, bool asSource)where T : struct
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
WeightHandler<T>
weightHandler
|
System.Boolean
asSource
|
Returns
EdgePath<T>[]
|
Type Parameters
T
|
ToEdgePaths<T>(RouterPoint, RouterDb, WeightHandler<T>, Boolean, Nullable<Boolean>)
Converts the router point to paths leading to the closest 2 vertices.
Declaration
public static EdgePath<T>[] ToEdgePaths<T>(this RouterPoint point, RouterDb routerDb, WeightHandler<T> weightHandler, bool asSource, bool ? forward)where T : struct
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
WeightHandler<T>
weightHandler
|
System.Boolean
asSource
|
System.Nullable<System.Boolean>
forward
|
Returns
EdgePath<T>[]
|
Type Parameters
T
|
ToEdgePathsDirected<T>(RouterPoint, RouterDb, WeightHandler<T>, Boolean)
Converts the router point to paths leading to the closest 2 vertices.
Declaration
public static EdgePath<T>[] ToEdgePathsDirected<T>(this RouterPoint point, RouterDb routerDb, WeightHandler<T> weightHandler, bool asSource)where T : struct
Parameters
RouterPoint
point
|
RouterDb
routerDb
|
WeightHandler<T>
weightHandler
|
System.Boolean
asSource
|
Returns
EdgePath<T>[]
|
Type Parameters
T
|
ToGeoJson(RouterPoint, RouterDb)
Returns a geojson description for
Declaration
public static string ToGeoJson(this RouterPoint routerPoint, RouterDb routerDb)
Parameters
RouterPoint
routerPoint
|
RouterDb
routerDb
|
Returns
System.String
|
VertexId(RouterPoint, RouterDb)
Returns the vertex id if any.
Declaration
public static uint VertexId(this RouterPoint point, RouterDb db)
Parameters
RouterPoint
point
|
RouterDb
db
|
Returns
System.UInt32
|