MapMatcher
-
This class provides map-matching functionality. It determines whether a location can be matched to a nearby road network and provides additional OCM map data for that location.
Note: This is a beta release of this feature. There may be bugs and unexpected behaviors. Related APIs may change in future releases without a deprecation process.
A
MapMatchermaintains an internal state across location updates. This helps to check if the match is consistent with previous matches or if an unrealistic jump occurred due to low accuracy of the provided location.A
MapMatcherrequires OCM tile data, either through caching, prefetching, or installedRegiondata. If the necessary tiles are not found, an online request is initiated. Note that in such cases, the download is triggered silently in the background, andnilis returned immediately.The
MapMatchersupports two layer configurations for retrieving segment geometry data:Rendering layer (
LayerConfiguration.Feature.RENDERING): Enabled by default. If your application uses map rendering orMapViewcomponents, using this layer is recommended.eHorizon layer (
LayerConfiguration.Feature.EHORIZON): Not enabled by default. It encodes segment geometries outside the rendering layer groups to reduce the amount of downloaded data. Use the eHorizon layer when:- No
MapViewis used in your application. - Only the eHorizon layer is used in your application. In these cases, using the eHorizon layer will reduce the required data to download. If the rendering layer is enabled, it will increase the required data to download.
- No
Important: If
useRenderingLayersis set tofalsewithout properly enabling the eHorizon layer, it may produce incorrect results. Layer configuration is especially important when prefetching or installing region data. Missing data will be downloaded online automatically as needed.If your hardware supports pitch and high precision altitude information and you want to use them in the
MapMatcherto improve map-matching, then enable theLayerConfiguration.Feature.ADASlayer:- Turn on the
ADASlayer viaLayerConfiguration.enabledFeatures(it will increase data consumption). - If available, set
location.pitchInDegrees,location.coordinates.altitudeandlocation.verticalAccuracyInMeters. - In case of issues, please contact your HERE representative.
Declaration
Swift
public class MapMatcherextension MapMatcher: NativeBaseextension MapMatcher: Hashable -
The result of matching the original location to the available map.
See moreDeclaration
Swift
public struct MatchedLocation
MapMatcher Reference