SafetyLocationElement
public struct SafetyLocationElement : HorizonElement
HorizonElement
that contains data about a safety location.
To receive such elements in the HorizonSnapshot
, specify HorizonElementType
.safetyLocationType
in the HorizonOptions
that you register with the HorizonEngine
:
let horizonOptions = HorizonOptions(
id: UUID(),
elementTypes: [.safetyLocationType],
...
)
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(id:
pathID: startOffset: endOffset: safetyLocationId: startLocation: endLocation: boundingBox: type: speedLimit: recommendedWarningDistance: isZone: ) Initializes instance of
SafetyLocationElement
.Declaration
Swift
public init( id: Int, pathID: Int, startOffset: Measurement<UnitLength>, endOffset: Measurement<UnitLength>, safetyLocationId: String, startLocation: CLLocationCoordinate2D, endLocation: CLLocationCoordinate2D, boundingBox: BoundingBox, type: SafetyLocationElement.SafetyLocationType, speedLimit: Measurement<UnitSpeed>?, recommendedWarningDistance: Measurement<UnitLength>?, isZone: Bool )
-
Safety location types.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum SafetyLocationType
-
Type of the element. Used to filter elements by type.
Declaration
Swift
public let elementType: HorizonElementType
-
Identifier of this element.
Declaration
Swift
public let id: Int
-
Identifier of the
HorizonPath
to which this element belongs.Declaration
Swift
public let pathID: Int
-
Start offset on the
HorizonPath
.Declaration
Swift
public let startOffset: Measurement<UnitLength>
-
End offset on the
HorizonPath
.Declaration
Swift
public let endOffset: Measurement<UnitLength>
-
Unique identifier of the safety location.
Declaration
Swift
public let safetyLocationId: String
-
Start coordinate of the safety location.
Declaration
Swift
public let startLocation: CLLocationCoordinate2D
-
End coordinate of the safety location.
Declaration
Swift
public let endLocation: CLLocationCoordinate2D
-
Bounding box encapsulating safety location.
Declaration
Swift
public let boundingBox: BoundingBox
-
Safety location
SafetyLocationType
.Declaration
Swift
public let type: SafetyLocationType
-
Maximum speed allowed for the safety location. Null if not available.
Declaration
Swift
public let speedLimit: Measurement<UnitSpeed>?
-
Recommended warning distance. Null if not available.
Declaration
Swift
public let recommendedWarningDistance: Measurement<UnitLength>?
-
True if the safety location is a zone (i.e., if the start point and the end point correspond to different locations). False otherwise.
Declaration
Swift
public let isZone: Bool