RoadGraph
public final class RoadGraph
RoadGraph
provides methods to get edge shape (e.g. RoadGraph.Edge
) and metadata.
You do not create a RoadGraph
object manually. Instead, observe the Notification.Name.electronicHorizonDidUpdatePosition
notification to obtain edge identifiers and get more details about the edges using the RouteController.roadGraph
or PassiveLocationDataSource.roadGraph
property.
-
Returns metadata about the edge with the given edge identifier.
Return Value
Metadata about the edge with the given edge identifier, or
nil
if the edge is inaccessible. -
Returns a line string geometry corresponding to the given edge identifier.
Declaration
Swift
public func edgeShape(edgeIdentifier: Edge.Identifier) -> LineString?
Return Value
A line string corresponding to the given edge identifier, or
nil
if the edge is inaccessible.
-
Keys in the user info dictionaries of various notifications posted by instances of
See moreRouteController
orPassiveLocationDataSource
aboutRoadGraph
s.Declaration
Swift
public struct NotificationUserInfoKey : Hashable, Equatable, RawRepresentable
-
An edge in a routing graph. For example, an edge may represent a road segment between two intersections or between the two ends of a bridge. An edge may traverse multiple road objects, and a road object may be associated with multiple edges.
An electronic horizon is a probable path (or paths) of a vehicle. The road network ahead of the user is represented as a tree of edges. Each intersection has outlet edges. In turn, each edge has a probability of transition to another edge, as well as details about the road segment that the edge traverses. You can use these details to influence application behavior based on predicted upcoming conditions.
During active turn-by-turn navigation, the user-selected route and its metadata influence the path of the electronic horizon determined by
RouteController
. During passive navigation (free-driving), no route is actively selected, soPassiveLocationDataSource
will determine the most probable path from the vehicle’s current location. You can receive notifications about changes in the current state of the electronic horizon by observing theNotification.Name.electronicHorizonDidUpdatePosition
,Notification.Name.electronicHorizonDidEnterRoadObject
, andNotification.Name.electronicHorizonDidExitRoadObject
notifications.Use a
See moreRoadGraph
object to get an edge with a given identifier.Declaration
Swift
public struct Edge
-
A position along a linear object in the road graph.
See moreDeclaration
Swift
public struct Path
-
The position of a point object in the road graph.
See moreDeclaration
Swift
public struct Position