TrafficSection

public struct TrafficSection : Section

The TrafficSection struct contains information about a part of the route related to traffic incidents.

  • Initializer.

    Declaration

    Swift

    public init(
        sectionLocation: SectionLocation,
        routeOffset: Measurement<UnitLength>,
        length: Measurement<UnitLength>,
        delay: Measurement<UnitDuration>,
        simpleCategory: String? = nil,
        magnitudeOfDelay: MagnitudeOfDelay? = nil,
        tec: Tec? = nil,
        effectiveSpeed: Measurement<UnitSpeed>? = nil,
        id: String? = nil
    )

    Parameters

    sectionLocation

    The location of the section.

    routeOffset

    The offset on the route where the section starts.

    length

    The length of the section.

    delay

    The delay caused by the incident.

    simpleCategory

    The category of the traffic incident.

    magnitudeOfDelay

    The magnitude of delay caused by the traffic incident.

    tec

    The details of the traffic incident.

    effectiveSpeed

    The effective speed of the incident, averaged over its entire length.

    id

    The traffic event id that the section refers to. Can be used to retrieve additonal information about the traffic event. Might be empty if the information is unavailable or the route provider does not support traffic ids. This information is currently not available for routes planned online.

  • The location of the section.

    Declaration

    Swift

    public var sectionLocation: SectionLocation
  • The offset on the route where the section starts.

    Declaration

    Swift

    public var routeOffset: Measurement<UnitLength>
  • The length of the section.

    Declaration

    Swift

    public var length: Measurement<UnitLength>
  • The category of the traffic incident

    Declaration

    Swift

    public let simpleCategory: String?
  • The magnitude of delay caused by the incident.

    Declaration

    Swift

    public let magnitudeOfDelay: MagnitudeOfDelay?
  • tec

    The details of the traffic incident.

    Declaration

    Swift

    public let tec: Tec?
  • The effective speed of the incident, averaged over its entire length.

    Declaration

    Swift

    public let effectiveSpeed: Measurement<UnitSpeed>?
  • The delay caused by the incident.

    Declaration

    Swift

    public let delay: Measurement<UnitDuration>
  • id

    The associated traffic event ID to query detailed traffic information while on the route, on user request. The data may include location details, length, and duration and may not be available to all traffic sections.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public let id: String?