Intersection
public struct Intersection : ForeignMemberContainer
extension Intersection: Codable
extension Intersection: Equatable
A single cross street along a step.
-
Declaration
Swift
public var foreignMembers: JSONObject
-
init(location:headings:approachIndex:outletIndex:outletIndexes:approachLanes:usableApproachLanes:preferredApproachLanes:laneValidIndications:outletRoadClasses:tollCollection:tunnelName:restStop:isUrban:regionCode:outletMapboxStreetsRoadClass:railroadCrossing:trafficSignal:stopSign:yieldSign:interchange:junction:)Initializes an intersection.
Declaration
Swift
public init(location: LocationCoordinate2D, headings: [LocationDirection], approachIndex: Int, outletIndex: Int, outletIndexes: IndexSet, approachLanes: [LaneIndication]?, usableApproachLanes: IndexSet?, preferredApproachLanes: IndexSet?, laneValidIndications: [ManeuverDirection?]? = nil, outletRoadClasses: RoadClasses? = nil, tollCollection: TollCollection? = nil, tunnelName: String? = nil, restStop: RestStop? = nil, isUrban: Bool? = nil, regionCode: String? = nil, outletMapboxStreetsRoadClass: MapboxStreetsRoadClass? = nil, railroadCrossing: Bool? = nil, trafficSignal: Bool? = nil, stopSign: Bool? = nil, yieldSign: Bool? = nil, interchange: Interchange? = nil, junction: Junction? = nil)Parameters
locationThe geographic coordinates at the center of the intersection.
headingsThe absolute headings of the roads that meet at the intersection.
approachIndexThe index of the item in
headingsthat corresponds to the road used to approach the intersection.outletIndexThe index of the item in
headingsthat corresponds to the road used to leave the intersection.outletIndexesThe indices of the items in
headingsthat correspond to the roads that may be used to leave the intersection.approachLanesAll the lanes of the road used to approach the intersection.
usableApproachLanesThe indices of the items in
approachLanesthat correspond to the lanes that may be used to execute the maneuver.preferredApproachLanesThe indices of the items in
approachLanesthat correspond to the lanes that are preferred to execute the maneuver.laneValidIndicationsFor each item in
approachLanes, the indication that is applicable to the current route, ornilfor a lane that has no applicable indication.outletRoadClassesThe road classes of the road used to leave the intersection.
tollCollectionThe toll collection point at the intersection.
tunnelNameThe name of the tunnel that the intersection is a part of.
restStopThe rest stop at the intersection.
isUrbanWhether the intersection lies within the bounds of an urban zone.
regionCodeA 2-letter region code identifying the country that the intersection lies in.
outletMapboxStreetsRoadClassThe Mapbox Streets road class of the road used to leave the intersection.
railroadCrossingWhether there is a railroad crossing at the intersection.
trafficSignalWhether there is a traffic signal at the intersection.
stopSignWhether there is a stop sign at the intersection.
yieldSignWhether there is a yield sign at the intersection.
interchangeInformation about routing and passing an interchange along the route.
junctionInformation about routing and passing a junction along the route.
-
init(location:headings:approachIndex:outletIndex:outletIndexes:approachLanes:usableApproachLanes:preferredApproachLanes:usableLaneIndication:outletRoadClasses:tollCollection:tunnelName:restStop:isUrban:regionCode:outletMapboxStreetsRoadClass:railroadCrossing:trafficSignal:stopSign:yieldSign:interchange:junction:)Initializes an intersection whose lanes all share a single applicable maneuver direction.
Lanes at the same intersection may legitimately have differing applicable maneuver directions, which a single
usableLaneIndicationcannot represent. Useinit(location:headings:approachIndex:outletIndex:outletIndexes:approachLanes:usableApproachLanes:preferredApproachLanes:laneValidIndications:…)instead, passing one indication per lane.Declaration
Swift
@available(*, deprecated, message: "Use the initializer that takes laneValidIndications, which reflects that lanes may have differing indications.") public init(location: LocationCoordinate2D, headings: [LocationDirection], approachIndex: Int, outletIndex: Int, outletIndexes: IndexSet, approachLanes: [LaneIndication]?, usableApproachLanes: IndexSet?, preferredApproachLanes: IndexSet?, usableLaneIndication: ManeuverDirection?, outletRoadClasses: RoadClasses? = nil, tollCollection: TollCollection? = nil, tunnelName: String? = nil, restStop: RestStop? = nil, isUrban: Bool? = nil, regionCode: String? = nil, outletMapboxStreetsRoadClass: MapboxStreetsRoadClass? = nil, railroadCrossing: Bool? = nil, trafficSignal: Bool? = nil, stopSign: Bool? = nil, yieldSign: Bool? = nil, interchange: Interchange? = nil, junction: Junction? = nil)Parameters
locationThe geographic coordinates at the center of the intersection.
headingsThe absolute headings of the roads that meet at the intersection.
approachIndexThe index of the item in
headingsthat corresponds to the road used to approach the intersection.outletIndexThe index of the item in
headingsthat corresponds to the road used to leave the intersection.outletIndexesThe indices of the items in
headingsthat correspond to the roads that may be used to leave the intersection.approachLanesAll the lanes of the road used to approach the intersection.
usableApproachLanesThe indices of the items in
approachLanesthat correspond to the lanes that may be used to execute the maneuver.preferredApproachLanesThe indices of the items in
approachLanesthat correspond to the lanes that are preferred to execute the maneuver.usableLaneIndicationThe indication that is applicable to the current route, shared by every lane that may be used to execute the maneuver.
outletRoadClassesThe road classes of the road used to leave the intersection.
tollCollectionThe toll collection point at the intersection.
tunnelNameThe name of the tunnel that the intersection is a part of.
restStopThe rest stop at the intersection.
isUrbanWhether the intersection lies within the bounds of an urban zone.
regionCodeA 2-letter region code identifying the country that the intersection lies in.
outletMapboxStreetsRoadClassThe Mapbox Streets road class of the road used to leave the intersection.
railroadCrossingWhether there is a railroad crossing at the intersection.
trafficSignalWhether there is a traffic signal at the intersection.
stopSignWhether there is a stop sign at the intersection.
yieldSignWhether there is a yield sign at the intersection.
interchangeInformation about routing and passing an interchange along the route.
junctionInformation about routing and passing a junction along the route.
-
The geographic coordinates at the center of the intersection.
Declaration
Swift
public let location: LocationCoordinate2D
-
An array of
LocationDirections indicating the absolute headings of the roads that meet at the intersection.A road is represented in this array by a heading indicating the direction from which the road meets the intersection. To get the direction of travel when leaving the intersection along the road, rotate the heading 180 degrees.
A single road that passes through this intersection is represented by two items in this array: one for the segment that enters the intersection and one for the segment that exits it.
Declaration
Swift
public let headings: [LocationDirection] -
The indices of the items in the
headingsarray that correspond to the roads that may be used to leave the intersection.This index set effectively excludes any one-way road that leads toward the intersection.
Declaration
Swift
public let outletIndexes: IndexSet
-
The index of the item in the
headingsarray that corresponds to the road that the containing route step uses to approach the intersection.This property is set to
nilfor a departure maneuver.Declaration
Swift
public let approachIndex: Int? -
The index of the item in the
headingsarray that corresponds to the road that the containing route step uses to leave the intersection.This property is set to
nilfor an arrival maneuver.Declaration
Swift
public let outletIndex: Int? -
The road classes of the road that the containing step uses to leave the intersection.
If road class information is unavailable, this property is set to
nil.Declaration
Swift
public let outletRoadClasses: RoadClasses? -
The road classes of the road that the containing step uses to leave the intersection, according to the Mapbox Streets source , version 8.
If detailed road class information is unavailable, this property is set to
nil. This property only indicates the road classification; for other aspects of the road, use theoutletRoadClassesproperty.Declaration
Swift
public let outletMapboxStreetsRoadClass: MapboxStreetsRoadClass? -
The name of the tunnel that this intersection is a part of.
If this Intersection is not a tunnel entrance or exit, or if information is unavailable then this property is set to
nil.Declaration
Swift
public let tunnelName: String? -
A toll collection point.
If this Intersection is not a toll collection intersection, or if this information is unavailable then this property is set to
nil.Declaration
Swift
public let tollCollection: TollCollection? -
Corresponding rest stop.
If this Intersection is not a rest stop, or if this information is unavailable then this property is set to
nil.Declaration
Swift
public let restStop: RestStop? -
Whether the intersection lays within the bounds of an urban zone.
If this information is unavailable, then this property is set to
nil.Declaration
Swift
public let isUrban: Bool? -
A 2-letter region code to identify corresponding country that this intersection lies in.
Automatically populated during decoding a
RouteLegobject, since this is the source of allAdministrativeRegions. Value isnilif such information is unavailable.Seealso
RouteStep.regionCode(atStepIndex:, intersectionIndex:)Declaration
Swift
public private(set) var regionCode: String? { get }
-
All the lanes of the road that the containing route step uses to approach the intersection. Each item in the array represents a lane, which is represented by one or more
LaneIndications.If no lane information is available for the intersection, this property’s value is
nil. The first item corresponds to the leftmost lane, the second item corresponds to the second lane from the left, and so on, regardless of whether the surrounding country drives on the left or on the right.Declaration
Swift
public let approachLanes: [LaneIndication]? -
The indices of the items in the
approachLanesarray that correspond to the lanes that may be used to execute the maneuver.If no lane information is available for an intersection, this property’s value is
nil.Declaration
Swift
public let usableApproachLanes: IndexSet? -
The indices of the items in the
approachLanesarray that correspond to the lanes that are preferred to execute the maneuver.If no lane information is available for an intersection, this property’s value is
nil.Declaration
Swift
public let preferredApproachLanes: IndexSet? -
For each item in the
approachLanesarray, which of itsLaneIndications is applicable to the current route when there is more than one.A lane’s entry is
nilif the lane has no applicable indication. Lanes at the same intersection may have differing entries: for example, one lane may indicate a straight maneuver while an adjacent lane indicates a slight turn, if both lanes can be used to execute the maneuver.If no lane information is available for the intersection, this property’s value is
nil.Declaration
Swift
public let laneValidIndications: [ManeuverDirection?]? -
Which of the
LaneIndications is applicable to the current route when there is more than one.If no lane information is available for the intersection, this property’s value is
nilNote
Lanes at the same intersection may legitimately have differing applicable indications, in which case this property collapses them to a single value, preferring the indication of a preferred lane, then that of a usable lane, then that of the first lane. UselaneValidIndicationsinstead to get every lane’s own indication.Declaration
Swift
@available(*, deprecated, message: "Use laneValidIndications, which reflects that lanes may have differing indications.") public var usableLaneIndication: ManeuverDirection? { get } -
Indicates whether there is a railroad crossing at the intersection.
If such information is not available for an intersection, this property’s value is
nil.Declaration
Swift
public let railroadCrossing: Bool? -
Indicates whether there is a traffic signal at the intersection.
If such information is not available for an intersection, this property’s value is
nil.Declaration
Swift
public let trafficSignal: Bool? -
Indicates whether there is a stop sign at the intersection.
If such information is not available for an intersection, this property’s value is
nil.Declaration
Swift
public let stopSign: Bool? -
Indicates whether there is a yield sign at the intersection.
If such information is not available for an intersection, this property’s value is
nil.Declaration
Swift
public let yieldSign: Bool? -
An object containing information about routing and passing interchange along the route. If such information is not available for an intersection, this property’s value is
nil.Declaration
Swift
public let interchange: Interchange? -
An object containing information about routing and passing junction along the route. If such information is not available for an intersection, this property’s value is
nil.Declaration
Swift
public let junction: Junction? -
Declaration
Swift
public func encode(to encoder: Encoder) throws -
Declaration
Swift
public init(from decoder: Decoder) throws -
Declaration
Swift
public static func == (lhs: Intersection, rhs: Intersection) -> Bool
Install in Dash
Intersection Structure Reference