Get started with Traffic
The HERE SDK provides real-time and predictive traffic information for routing and navigation use cases.
- Use the
TrafficEngineto query traffic incidents and traffic flow information. - Calculate routes with the online
RoutingEnginethat include predicted traffic information and jam factors as part of theRouteobject. This can be used to render traffic information directly on the route during route preview. - The
RoutingEnginealso allows querying updatedTrafficOnRouteinformation. This can be useful for updating the ETA or refreshing the rendered traffic along the route. - During navigation, the
VisualNavigatorcan optionally renderTrafficOnRoute(available only with the Navigate license). - On the map view, traffic incidents and traffic flow information can be visualized in real time using the
MapFeatures.trafficFlowandMapFeatures.trafficIncidentsmap features.
Note that navigation features are only available for the HERE SDK (Navigate).
Real-time versus predictive traffic data sources
- Real-time traffic data represents the current traffic situation at the moment of the request. This data is based on information such as actual road conditions, vehicle speeds, and reported incidents. The map visualization using
MapFeatures.trafficFlowis mostly based on real-time traffic data. - Predictive traffic data anticipates future traffic conditions based on information such as historical patterns and current trends, including real-time data. The
RoutingEngineand the includedTrafficOnRoutedata is mostly based on predictive traffic data as this allows to calculate the expected ETA and forecast traffic conditions more precisely while travelling towards the destination.
The main difference is timing: real-time data shows what's happening now, while predictive data estimates what will happen when you reach that part of your route. This can lead to discrepancies:
- A route calculated now might show different jam factors than the real-time traffic flow map feature, because the route considers also predicted conditions for later roads when you'll actually be driving there.
- The
TrafficEnginequeries can return different data than what's shown on theMapFeatures.trafficFlowlayer, as requests may happen at different times. - Route-based traffic data (updated via
TrafficOnRoute) uses predictive models, while the traffic flow map feature shows current conditions.
Data sources and APIs
- Real-time traffic visualized on the map is based on HERE Traffic Vector Tile API. An example of a transaction based on Traffic Vector Tile API is: Render
MapFeatures.trafficFlowand / orMapFeatures.trafficIncidentson the map view. Please note that each feature request is counted as an individual transaction. For instance, if a user requests both traffic flow and traffic incident data, this will be considered as two separate transactions by the HERE backend system. By default, new requests are triggered when new vector tiles are loaded during map panning and zooming or when the traffic backend's set validity time expires while the vector tiles are visible on the map view. You can adjust the default refresh period usingMapContentSettings.setTrafficRefreshPeriod(..), which allows overriding the backend's validity time to set a refresh period anywhere between 1 and 5 minutes. However, if the map is panned or moved to a new viewport area, for example, during navigation, the HERE SDK will instantly initiate new requests. - Predicted traffic data used for routing and navigation is based on HERE Traffic API v7. Examples of transactions based on the HERE Traffic API v7: Request traffic flow data or incidents with the
TrafficEngineor requestTrafficOnRoutedata with theRoutingEngine.
NoteFor information about the pricing of these features, see the HERE Base Plan Pricing. If you are using the Navigate license or have other questions about pricing, contact us.
Next steps
- Show traffic on the map: Use map features to show real-time traffic and incidents on the map view.
- Traffic Engine: Learn how to query traffic incidents and flow information programmatically.
- Visualize traffic on routes: Show current traffic conditions along a route.
- Get ETA and traffic information: Calculate routes and retrieve ETA and traffic information from route objects.
- Update traffic information: Update traffic during turn-by-turn navigation.
Updated 12 hours ago