Intersection

public struct Intersection
extension Intersection: Codable
extension Intersection: Equatable

A single cross street along a step.

  • 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 headings array 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 headings array that corresponds to the road that the containing route step uses to approach the intersection.

    This property is set to nil for a departure maneuver.

    Declaration

    Swift

    public let approachIndex: Int?
  • The index of the item in the headings array that corresponds to the road that the containing route step uses to leave the intersection.

    This property is set to nil for 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 the outletRoadClasses property.

    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 RouteLeg object, since this is the source of all AdministrativeRegions. Value is nil if 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 approachLanes array 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 approachLanes array 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?
  • 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 nil

    Declaration

    Swift

    public let usableLaneIndication: ManeuverDirection?
  • 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