Attributes
public struct Attributes : Equatable, ForeignMemberContainer
extension RouteLeg.Attributes: Codable
A collection of per-segment attributes along a route leg.
-
Declaration
Swift
public var foreignMembers: JSONObject
-
An array containing the distance (measured in meters) between each coordinate in the route leg geometry.
This property is set if the
RouteOptions.attributeOptions
property containsAttributeOptions.distance
.Declaration
Swift
public var segmentDistances: [LocationDistance]?
-
An array containing the expected travel time (measured in seconds) between each coordinate in the route leg geometry.
These values are dynamic, accounting for any conditions that may change along a segment, such as traffic congestion if the profile identifier is set to
.automobileAvoidingTraffic
.This property is set if the
RouteOptions.attributeOptions
property containsAttributeOptions.expectedTravelTime
.Declaration
Swift
public var expectedSegmentTravelTimes: [TimeInterval]?
-
An array containing the expected average speed (measured in meters per second) between each coordinate in the route leg geometry.
These values are dynamic; rather than speed limits, they account for the road’s classification and/or any traffic congestion (if the profile identifier is set to
.automobileAvoidingTraffic
).This property is set if the
RouteOptions.attributeOptions
property containsAttributeOptions.speed
.Declaration
Swift
public var segmentSpeeds: [LocationSpeed]?
-
An array containing the traffic congestion level along each road segment in the route leg geometry.
Traffic data is available in a number of countries and territories worldwide.
You can color-code a route line according to the congestion level along each segment of the route.
This property is set if the
RouteOptions.attributeOptions
property containsAttributeOptions.congestionLevel
.Declaration
Swift
public var segmentCongestionLevels: [CongestionLevel]?
-
An array containing the traffic congestion level along each road segment in the route leg geometry.
Traffic data is available in a number of countries and territories worldwide.
You can color-code a route line according to the congestion level along each segment of the route.
This property is set if the
RouteOptions.attributeOptions
property containsAttributeOptions.numericCongestionLevel
.Declaration
Swift
public var segmentNumericCongestionLevels: [NumericCongestionLevel?]?
-
An array containing the maximum speed limit along each road segment along the route leg’s shape.
The maximum speed may be an advisory speed limit for segments where legal limits are not posted, such as highway entrance and exit ramps. If the speed limit along a particular segment is unknown, it is represented in the array by a measurement whose value is negative. If the speed is unregulated along the segment, such as on the German Autobahn system, it is represented by a measurement whose value is
Double.infinity
.Speed limit data is available in a number of countries and territories worldwide.
This property is set if the
RouteOptions.attributeOptions
property containsAttributeOptions.maximumSpeedLimit
.Declaration
Swift
public var segmentMaximumSpeedLimits: [Measurement<UnitSpeed>?]?
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws