HorizonSnapshot

public struct HorizonSnapshot

Snapshot of the horizon provided by the horizon engine, based on a set of previously registered horizon subscription options. Subscription options define the extent of the paths in the horizon as well as which map attributes are collected for those paths.

Important

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

Public

  • The list of predicted Paths.

    Declaration

    Swift

    public let paths: [HorizonPath]
  • Positions are sorted by the most likely place the user is.

    Declaration

    Swift

    public let positions: [HorizonPosition]
  • The main path is the path on which the vehicle is located.

    Declaration

    Swift

    public func mainPath() throws -> HorizonPath

    Return Value

    The main horizon path.

  • Get all the horizon elements of type type that are untill a certain distanceAhead of the current position in the mainPath

    Important

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

    Declaration

    Swift

    public func elementsAhead(
        inDistance distanceAhead: Measurement<UnitLength>,
        type: HorizonElementType
    ) throws -> [HorizonElement]

    Parameters

    inDistance

    The distance for which we want HorizonElements

    type

    The requested horizon element type.

    Return Value

    List of found HorizonElements

  • Calculates the tree distance to the given horizon element. Negative values indicate elements the vehicle has already passed. Positive values indicate elements ahead of the vehicle.

    Important

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

    Declaration

    Swift

    public func distanceTo(element: HorizonElement) throws -> Measurement<UnitLength>

    Parameters

    element

    The element to which we want to know the distance.

    Return Value

    The tree distance to the horizon element.