TransportApiExtensions (Class)

Namespace: Wrld.Transport

Extension methods for TransportApi.

Methods

IList<​TransportNode​> GetNodesForNetworkAndCell (TransportApi transportApi, TransportNetworkType transportNetwork, TransportCellKey cellKey)

Get all TransportNode objects currently streamed in for the given transport network and cell.

Returns: The list of TransportNode objects for the given network and cell.

Argument Type Description
transportApi TransportApi TransportApi instance.
transportNetwork TransportNetworkType The returned results are filtered to contain only objects belonging to this transport network.
cellKey TransportCellKey The returned results are filtered to contain only objects belonging to this cell.

IList<​TransportDirectedEdge​> GetDirectedEdgesForNetworkAndCell (TransportApi transportApi, TransportNetworkType transportNetwork, TransportCellKey cellKey)

Get all TransportDirectedEdge objects currently streamed in for the given transport network and cell.

Returns: The list of TransportDirectedEdge objects for the given network and cell.

Argument Type Description
transportApi TransportApi TransportApi instance.
transportNetwork TransportNetworkType The returned results are filtered to contain only objects belonging to this transport network.
cellKey TransportCellKey The returned results are filtered to contain only objects belonging to this cell.

IList<​TransportWay​> GetWaysForNetworkAndCell (TransportApi transportApi, TransportNetworkType transportNetwork, TransportCellKey cellKey)

Get all TransportWay objects currently streamed in for the given transport network and cell.

Returns: The list of TransportWay objects for the given network and cell.

Argument Type Description
transportApi TransportApi TransportApi instance.
transportNetwork TransportNetworkType The returned results are filtered to contain only objects belonging to this transport network.
cellKey TransportCellKey The returned results are filtered to contain only objects belonging to this cell.

String NodeIdToString (TransportApi transportApi, TransportNodeId nodeId)

Get a string representation for a given TransportNodeId.

Returns: A string representation of the id, in format <networkType>:<cellKey>:<localId>.

Argument Type Description
transportApi TransportApi TransportApi instance.
nodeId TransportNodeId The id of a TransportNode.

String DirectedEdgeIdToString (TransportApi transportApi, TransportDirectedEdgeId directedEdgeId)

Get a string representation for a given TransportDirectedEdgeId.

Returns: A string representation of the id, in format <networkType>:<cellKey>:<localId>.

Argument Type Description
transportApi TransportApi TransportApi instance.
directedEdgeId TransportDirectedEdgeId The id of a TransportDirectedEdge.

String WayIdToString (TransportApi transportApi, TransportWayId wayId)

Get a string representation for a given TransportWayId.

Returns: A string representation of the id, in format <networkType>:<cellKey>:<localId>.

Argument Type Description
transportApi TransportApi TransportApi instance.
wayId TransportWayId The id of a TransportDirectedWay.

TransportGraph CreateTransportGraph (TransportApi transportApi, TransportNetworkType transportNetwork)

TransportGraph factory method.

Returns: A TransportGraph instance.

Argument Type Description
transportApi TransportApi TransportApi instance.
transportNetwork TransportNetworkType The transport network for which the TransportGraph will be created.

double GetParameterOnDirectedEdge (TransportPositionerPointOnGraph transportPositionerPointOnGraph)

For a given TransportPositionerPointOnGraph, returns the parameterized distance along the TransportDirectedEdge on which the point lies (as opposed to TransportPositionerPointOnGraph.ParameterizedPointOnWay, the parameterized distance along the associated TransportWay).

Returns: If transportPositionerPointOnGraph.IsMatched is true, the parameterized distance along the directed edge, in range 0.0 to 1.0; else 0.0.

Argument Type Description
transportPositionerPointOnGraph TransportPositionerPointOnGraph TransportPositionerPointOnGraph instance.

DoubleVector3 GetPointEcefOnPath (TransportApi transportApi, TransportPathfindResult pathfindResult, double t)

Get a point at a parameterized distance along the path represented by a given TransportPathfindResult.

Returns: A point in ECEF coordinates.

Argument Type Description
transportApi TransportApi TransportApi instance.
pathfindResult TransportPathfindResult Pathfind result, as returned by TransportApi.FindShortestPath.
t double A parameterized distance along the path, in the range 0.0 to 1.0.

DoubleVector3 GetDirectionEcefOnPath (TransportApi transportApi, TransportPathfindResult pathfindResult, double t)

Get the center-line direction at a parameterized distance along the path represented by a given TransportPathfindResult.

Returns: A unit direction vector in ECEF coordinates.

Argument Type Description
transportApi TransportApi TransportApi instance.
pathfindResult TransportPathfindResult Pathfind result, as returned by TransportApi.FindShortestPath.
t double A parameterized distance along the path, in the range 0.0 to 1.0.
v0.8.17