HorizonSnapshot

class HorizonSnapshot(val paths: List<HorizonPath>, val state: HorizonSnapshotState, mainPathId: Int?)

Snapshot of the horizon provided by the horizon engine, based on a set of previously registered horizon options. Subscription options define the extent of the paths on 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.

Parameters

paths

The list of horizon paths, consisting of the main path and zero or more sub-paths. The main path is where the vehicle is located. A sub-path is any path in the horizon snapshot that is not the main path.

state

The horizon snapshot state.

mainPathId

The id of the main path. Null if there is no on-road position.

Constructors

Link copied to clipboard
constructor(paths: List<HorizonPath>, state: HorizonSnapshotState, mainPathId: Int?)

Functions

Link copied to clipboard

Returns the tree distance from the specified position to the start offset of the given horizon element. The distance is strictly positive for elements in front of the position, i.e.: 1. elements on the position path in front of the position (the start offset of the element is greater than the position offset) 2. elements on sub-paths that the vehicle can reach by successively deviating to child paths. The distance is strictly negative for elements behind the vehicle that the vehicle has driven past, i.e.: 1. elements on the position path, which are completely behind the position or overlap the position, but start before the position (the start offset of the element is less than the position offset) 2. elements on sub-paths that the vehicle has deviated from at some point in the past. The distance is 0 for elements that start at the position (the start offset of the element on the position path is the same as the position offset). The distance is null if any of the following is true: 1. the position does not have a valid path id 2. there is no path in the snapshot with the same id as the one stored in the position 3. the given element does not exist in the snapshot 4. the given element is an element behind the position that the vehicle has not moved past, i.e. elements on sub-paths behind the vehicle that the vehicle has not taken.

Link copied to clipboard

Returns the coordinates of the element on the path. If the element is a spot element, the returned list contains one point. If the element is a segment element, the returned list contains a list of points in the sequence from the element start to end, including also all intermediate points. If the element is not in the snapshot, the returned list is empty.

Link copied to clipboard
fun elementsAhead(position: HorizonPosition, distanceAhead: Distance): List<HorizonElement>

Returns the horizon elements that are ahead of the given position on the path to which the position belongs, within the given distance. Elements of the same type are provided in increasing order of the start offset and end offset.

Returns the horizon elements of the given type that are ahead of the given position on the path to which the position belongs, within the given distance. The elements are provided in increasing order of the start offset and end offset.

Returns the horizon elements of the given types that are ahead of the given position on the path to which the position belongs, within the given distance. Elements of the same type are provided in increasing order of the start offset and end offset.

Link copied to clipboard

Returns the main horizon path. The main path is the path on which the first on-road position is located.

Link copied to clipboard

Returns the list of horizon sub-paths. A sub-path is any path that is not the main path.

Properties

Link copied to clipboard
Link copied to clipboard