Show / Hide Table of Contents

Class LocationExtensions

Extension methods for locations.

Inheritance
System.Object
LocationExtensions
Inherited Members
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 static class LocationExtensions

Methods

AdjustToValidDistance(ReferencedLine, Coder, List<Int32>, Int32)

Adjusts this location by inserting intermediate LR-points if needed.

Declaration
public static void AdjustToValidDistance(this ReferencedLine line, Coder coder, List<int> points, int start = 0)
Parameters
ReferencedLine line

Coder coder

List<System.Int32> points

System.Int32 start

AdjustToValidPoints(ReferencedLine, Coder)

Adjusts this location to use valid LR-points.

Declaration
public static void AdjustToValidPoints(this ReferencedLine line, Coder coder)
Parameters
ReferencedLine line

Coder coder

BuildLocationReferencePoint(ReferencedLine, Coder, Int32, Int32)

Builds a location referenced point for the vertex at the given start-index.

Declaration
public static LocationReferencePoint BuildLocationReferencePoint(this ReferencedLine referencedLocation, Coder coder, int start, int end)
Parameters
ReferencedLine referencedLocation

Coder coder

System.Int32 start

System.Int32 end

Returns
LocationReferencePoint

BuildLocationReferencePointLast(ReferencedLine, Coder, Int32)

Builds a location referenced point for the last vertex.

Declaration
public static LocationReferencePoint BuildLocationReferencePointLast(this ReferencedLine referencedLocation, Coder coder, int before)
Parameters
ReferencedLine referencedLocation

Coder coder

System.Int32 before

Returns
LocationReferencePoint

BuildPathFromLine(ReferencedLine, RouterDb, out RouterPoint, out RouterPoint)

Builds a path from the given referenced line start and the first referenced point and ending at the last.

Declaration
public static EdgePath<float> BuildPathFromLine(this ReferencedLine referencedLine, RouterDb routerDb, out RouterPoint source, out RouterPoint target)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

RouterPoint source

RouterPoint target

Returns
EdgePath<System.Single>

BuildPathFromLine(ReferencedLine, RouterDb, out RouterPoint, out Single, out RouterPoint, out Single)

Builds a path from the given referenced line start and the first referenced point and ending at the last.

Declaration
public static EdgePath<float> BuildPathFromLine(this ReferencedLine referencedLine, RouterDb routerDb, out RouterPoint source, out float postiveOffsetInMeters, out RouterPoint target, out float negativeOffsetInMeters)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

RouterPoint source

System.Single postiveOffsetInMeters

RouterPoint target

System.Single negativeOffsetInMeters

Returns
EdgePath<System.Single>

BuildPathFromLine(ReferencedLine, RouterDb, out Single, out Single)

Builds a path from the given referenced line start and the first referenced point and ending at the last.

Declaration
public static EdgePath<float> BuildPathFromLine(this ReferencedLine referencedLine, RouterDb routerDb, out float postiveOffsetInMeters, out float negativeOffsetInMeters)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

System.Single postiveOffsetInMeters

System.Single negativeOffsetInMeters

Returns
EdgePath<System.Single>

GetCoordinates(ReferencedLine, Coder, Single, out Int32, out Coordinate, out Single, out Single, out Single)

Converts the referenced line location to a list of sorted coordinates.

Declaration
public static List<Coordinate> GetCoordinates(this ReferencedLine route, Coder coder, float offsetRatio, out int offsetEdgeIdx, out Coordinate offsetLocation, out float offsetLength, out float offsetEdgeLength, out float edgeLength)
Parameters
ReferencedLine route

Coder coder

System.Single offsetRatio

System.Int32 offsetEdgeIdx

Coordinate offsetLocation

System.Single offsetLength

System.Single offsetEdgeLength

System.Single edgeLength

Returns
List<Coordinate>

GetCoordinates(ReferencedLine, RouterDb)

Converts the referenced line location to features.

Declaration
public static List<Coordinate> GetCoordinates(this ReferencedLine referencedLine, RouterDb routerDb)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

Returns
List<Coordinate>

GetCoordinates(ReferencedLine, RouterDb, Int32, Int32)

Converts the referenced line location to features.

Declaration
public static List<Coordinate> GetCoordinates(this ReferencedLine referencedLine, RouterDb routerDb, int start, int count)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

System.Int32 start

System.Int32 count

Returns
List<Coordinate>

GetLocationEdge(ReferencedPointAlongLine, RouterDb)

Gets the edge closest to the location in the point along line.

Declaration
public static long GetLocationEdge(this ReferencedPointAlongLine pointAlongLine, RouterDb routerDb)
Parameters
ReferencedPointAlongLine pointAlongLine

RouterDb routerDb

Returns
System.Int64

GetLocationEdge(ReferencedPointAlongLine, RouterDb, out Single)

Gets the edge closest to the location in the point along line.

Declaration
public static long GetLocationEdge(this ReferencedPointAlongLine pointAlongLine, RouterDb routerDb, out float offsetInMeter)
Parameters
ReferencedPointAlongLine pointAlongLine

RouterDb routerDb

System.Single offsetInMeter

Returns
System.Int64

GetNegativeOffsetLocation(ReferencedLine, RouterDb)

Gets the negative offset location.

Declaration
public static Coordinate GetNegativeOffsetLocation(this ReferencedLine referencedLine, RouterDb routerDb)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

Returns
Coordinate

GetNegativeOffsetRouterPoint(ReferencedLine, RouterDb)

Gets the negative offset routerpoint.

Declaration
public static RouterPoint GetNegativeOffsetRouterPoint(this ReferencedLine referencedLine, RouterDb routerDb)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

Returns
RouterPoint

GetOffsetRouterPoint(ReferencedLine, RouterDb, Single)

Gets a positive offset routerpoint.

Declaration
public static RouterPoint GetOffsetRouterPoint(this ReferencedLine referencedLine, RouterDb routerDb, float positiveOffsetPercentage)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

System.Single positiveOffsetPercentage

Returns
RouterPoint

GetPositionLocation(List<Coordinate>, Single)

Returns the location of the given position using the given coordinates as the polyline.

Declaration
public static Coordinate GetPositionLocation(this List<Coordinate> coordinates, float position)
Parameters
List<Coordinate> coordinates

The polyline coordinates.

System.Single position

The position parameter [0-1].

Returns
Coordinate

GetPositiveOffsetLocation(ReferencedLine, RouterDb)

Gets the positive offset location.

Declaration
public static Coordinate GetPositiveOffsetLocation(this ReferencedLine referencedLine, RouterDb routerDb)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

Returns
Coordinate

GetPositiveOffsetRouterPoint(ReferencedLine, RouterDb)

Gets the positive offset routerpoint.

Declaration
public static RouterPoint GetPositiveOffsetRouterPoint(this ReferencedLine referencedLine, RouterDb routerDb)
Parameters
ReferencedLine referencedLine

RouterDb routerDb

Returns
RouterPoint

GetVerticesSet(ReferencedLine)

Gets all vertices in one hashset.

Declaration
public static HashSet<uint> GetVerticesSet(this ReferencedLine line)
Parameters
ReferencedLine line

Returns
HashSet<System.UInt32>

ProjectOn(ReferencedLine, RouterDb, Single, Single)

Projects the given coordinates on the referenced line and returns the edge.

Declaration
public static long ProjectOn(this ReferencedLine line, RouterDb routerDb, float latitude, float longitude)
Parameters
ReferencedLine line

RouterDb routerDb

System.Single latitude

System.Single longitude

Returns
System.Int64

ProjectOn(ReferencedLine, RouterDb, Single, Single, out Single)

Projects the given coordinates on the referenced line and returns the edge.

Declaration
public static long ProjectOn(this ReferencedLine line, RouterDb routerDb, float latitude, float longitude, out float offsetInMeter)
Parameters
ReferencedLine line

RouterDb routerDb

System.Single latitude

System.Single longitude

System.Single offsetInMeter

Returns
System.Int64

TryAdjustToValidPointBackwards(ReferencedLine, Coder, UInt32, UInt32, HashSet<UInt32>)

Tries to adjust this location backwards to a valid point.

Declaration
public static bool TryAdjustToValidPointBackwards(this ReferencedLine line, Coder coder, uint vertex1, uint vertex2, HashSet<uint> exclude)
Parameters
ReferencedLine line

Coder coder

System.UInt32 vertex1

System.UInt32 vertex2

HashSet<System.UInt32> exclude

Returns
System.Boolean

TryAdjustToValidPointForwards(ReferencedLine, Coder, Int64, Int64, HashSet<UInt32>)

Tries to adjust this location forwards to a valid point.

Declaration
public static bool TryAdjustToValidPointForwards(this ReferencedLine line, Coder coder, long vertex1, long vertex2, HashSet<uint> exclude)
Parameters
ReferencedLine line

Coder coder

System.Int64 vertex1

System.Int64 vertex2

HashSet<System.UInt32> exclude

Returns
System.Boolean

ValidateBinary(ReferencedLine)

Validates the location for encoding in binary format.

Declaration
public static void ValidateBinary(this ReferencedLine line)
Parameters
ReferencedLine line

ValidateConnected(ReferencedLine, Coder)

Validates if the location is connected.

Declaration
public static void ValidateConnected(this ReferencedLine line, Coder coder)
Parameters
ReferencedLine line

Coder coder

ValidateOffsets(ReferencedLine)

Validates the offsets.

Declaration
public static void ValidateOffsets(this ReferencedLine line)
Parameters
ReferencedLine line

Back to top Built by Itinero, MIT licensed.