Map Matching
SDK for Android performs Map Matching automatically when it needs to match a raw position to the road network, e.g. during drive guidance, where there may be inaccuracies in the road rendering or GPS data. Map matching also supports instances where the GPS signal is lost while entering a road tunnel. The position is extrapolated and updated based on the driver’s speed and knowledge of the tunnel layout.
Automotive Map Matching
SDK for Android supports high-accuracy map matching through the LocationDataSourceAutomotive
class. As a requirement to use this class you must have positioning data input from a GNSS module that supports dead reckoning. This ensures a continuous and reliable stream of position updates even in cases where the GPS becomes unavailable (for example, when the user is driving in a tunnel). It is strongly recommended that position updates are provided at a constant rate of 10 Hz together with standard deviations of the following:
- Horizontal radial error (large component)
- Horizontal radial error (small component)
- Course
- Speed
- Elevation
- Automotive Map Matching is currently offered as a beta feature. APIs may change without notice.
- Automotive Map Matching does not support tunnel extrapolation.
Custom Data Sources
In general, you can use any custom positioning data by implementing the LocationDataSource
class and set it by calling PositioningManager.setDataSource(LocationDataSource)
before starting the positioning manager.
LocationDataSource.start(LocationMethod)
requires a LocationMethod
parameter, it is not necessary for your data source to support all PositioningManager.LocationMethod
types. You can support tunnel extrapolation while using a Custom Data Source by following these steps:
- When the data source location data is unavailable, check to see if the device is currently in a tunnel:
RoadElement roadElement = getPositioningManager().getRoadElement(); if (roadElement != null && roadElement.getAttributes().contains(RoadElement.Attribute.TUNNEL)) { return true; } return false;
- If the device is in a tunnel, submit a
null
location throughLocationDataSource.onLocationUpdated(LocationMethod, Location)
at an interval of once per second. HERE SDK then provides an extrapolated position in the tunnel. - Continue to periodically send
null
positions to the positioning manager while the device is in a tunnel. You can implement a timer so thatonLocationUpdated(LocationMethod, Location)
calls stop after a period of time (after one minute, for example) and re-enable updates when location data is available again.