MapMatchingEngine

Interface to a Map Matcher Engine.

Map Matcher is a component that tries to match position input (includes GNSS data, existing route) to a point on a map. The output of MapMatchingEngine is a map-matching result that contains an accurate (matched) location along with additional information such as alternative and predicted locations. Depending on the availability of geolocation input data, Map Matcher works in two modes:

  • when available - retrieving a map-matched location based on the input data.

  • when not available - extrapolating the location based on the last known location. It is used when there is no GNSS data available, for instance, when the device is in a tunnel. If there is no last known location, extrapolation is not possible, and the map-matching result is null.

The Navigation SDK provides factories to create map matcher engines. One of them is the com.tomtom.sdk.navigation.mapmatching.tilestore.TileStoreMapMatchingEngineFactory which creates a map matcher engine. This factory creates an engine that attempts to match the position input to the navigation tile data (provided by an online map). To do so, it uses a map-based com.tomtom.sdk.datamanagement.navigationtile.NavigationTileStore. A client application must specify the data store when creating the engine.

To create a com.tomtom.sdk.datamanagement.navigationtile.NavigationTileStore an API key is required. With the key you configure the store by setting up the com.tomtom.sdk.datamanagement.navigationtile.NavigationTileStoreConfiguration:

val navigationTileStoreConfiguration = NavigationTileStoreConfiguration(apiKey = NAVIGATION_API_KEY)
val navigationTileStore = NavigationTileStore.create(context, navigationTileStoreConfiguration)

To create a map-matching engine, use the com.tomtom.sdk.navigation.mapmatching.tilestore.TileStoreMapMatchingEngineFactory class:

val mapMatcherEngine = TileStoreMapMatchingEngineFactory.create(navigationTileStore)

To match the location to a position on a map, use the matchLocation function:

val mapMatchingResult = mapMatcherEngine.matchLocation(navigationSnapshot)

To extrapolate the location, use the extrapolateLocation function:

val mapMatchingResult = mapMatcherEngine.extrapolateLocation(navigationSnapshot)

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

Functions

Link copied to clipboard
abstract fun extrapolateLocation(navigationSnapshot: NavigationSnapshot): MapMatchingResult?

Attempts to extrapolate location based on the navigation snapshot, provided we have a previously map-matched result. The method should be used when there is no GNSS input data available (in the tunnel for example).

Link copied to clipboard
abstract fun matchLocation(navigationSnapshot: NavigationSnapshot): MapMatchingResult

Attempts to match location based on the navigation snapshot, provided we have GNSS input data.

Inherited functions

Link copied to clipboard
abstract fun close()