HorizonOptions

class HorizonOptions(val elementTypes: List<HorizonElementType>, val mainPathSearchOptions: MainPathSearchOptions = MainPathSearchOptions(), val subPathSearchOptions: List<SubPathSearchOptions> = listOf(), val numberOfPaths: Int = DEFAULT_NUMBER_OF_PATHS)

Horizon configuration options.

Horizon options define the extent of the paths in the horizon and the map attributes to be collected for these paths. A set of horizon options consists of the following:

  • The set of horizon element types the client is interested in.

  • The path search options for the main path.

  • The path search options for sub-paths.

  • The maximum number of paths the client can receive.

To specify horizon options, create an instance of this class:

val mainPathSearchOptions = MainPathSearchOptions(
searchTime = 10.minutes,
searchDistancePolicy = ExplicitDistancePolicy(
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(5)
)
)
)
val subPathSearchOptionsLevel1 = SubPathSearchOptions(
searchTime = 5.minutes,
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(2)
)
)
val subPathSearchOptionsLevel2 = SubPathSearchOptions(
searchTime = 3.minutes,
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(1)
)
)
val horizonOptions = HorizonOptions(
elementTypes = listOf(SpeedLimitsElementType, StreetElementType),
mainPathSearchOptions = mainPathSearchOptions,
subPathSearchOptions = listOf(subPathSearchOptionsLevel1, subPathSearchOptionsLevel2),
numberOfPaths = 4
)

For more information on horizon element types and horizon paths see HorizonEngine.

A client application can register multiple sets of horizon options and request the engine to provide data for all or only some of the registered option sets. The engine generates a separate horizon result for each set of options in the request. The client can also update horizon configuration by registering a new set of options or unregistering a previously registered set.

To register a set of horizon options, call the HorizonEngine.registerHorizonOptions function.

To unregister a set of horizon options, call the HorizonEngine.unregisterHorizonOptions function.

Throws

Constructors

Link copied to clipboard
constructor(elementTypes: List<HorizonElementType>, mainPathSearchOptions: MainPathSearchOptions = MainPathSearchOptions(), subPathSearchOptions: List<SubPathSearchOptions> = listOf(), numberOfPaths: Int = DEFAULT_NUMBER_OF_PATHS)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Types of horizon elements of interest.

Link copied to clipboard

Search options for the main path. The default value is an instance of MainPathSearchOptions created with default values for all constructor parameters.

Link copied to clipboard

Maximum number of paths the client can receive. The default value is DEFAULT_NUMBER_OF_PATHS. If subPathSearchOptions is empty, the client can only receive at most one path.

Link copied to clipboard

Search options for sub-paths, specified per path level. The list element at index i encodes search options for path level i + 1. The horizon is extended to the deepest path level, as determined by this parameter. The default value is an empty list.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String