HERE Real-Time Traffic data
HERE Real-Time Traffic data on the platform is visualized with the dedicated GeoJSON rendering plugin. By editing the default plugin code, you can customize your visualization as needed.
The plugin for HERE Real-Time Traffic data is included in the data schema of the Flow layer: 
Example app
Before you can visualize traffic flow data, you need to know the HERE Resource Name (HRN) of the layer that contains this data and the zoom level of the layer with traffic data. You can find the catalog HRN in the Data section of the portal.
To visualize HERE Real-Time Traffic Data from a catalog, follow these steps:
-
Install the web app generator and enter your application name when prompted.
-
When prompted
What kind of data will you visualize on top of the Base map?, select the optionTraffic Flow data. -
When prompted
HRN of the Catalog you want to visualize?, enter the HRN of the catalog that has traffic data. -
When prompted
Name of the layer you want to visualize?, enter the name of the layer that contains traffic data. -
When prompted
On which level the data is stored?, enter the level of the layer with traffic data. -
Once the code is generated, you can build and serve the web app by running the following command:
npm run startTo see the web app, open
http://localhost:8080in a web browser.To render the base map, enter the credentials that you obtained from the platform. {/* ## The Speed Limit Data Source You could build your own Data Source to visualize Data even if it doesn't contain latitude and longitude. Instead, you could map your data to the topology segments from HERE Map Content. For that purpose your could use Geometry Data Provider that provides geometry from topology-geometry layer from HERE Map Content. To understand how to use this data provider, let's examine an implementation of sample
SpeedLimitsDataSourcefrom speed limits example. You can find source code of this datasource insrc/datasources/speedLimitsDataSourceof an@here/olp-examplespackage. Constructor ofSpeedLimitsDataSourceaccepts an instance ofSegmentAnchorGeometryDataProvideras one of its parameters. This class provides geometry for a specificSegmentAnchorfrom RIB topology data.SegmentAnchoris an object which describes a linear chains of road segments. This is a common way of mapping data to road geometries from RIB road topology layer. You can find more information onSegmentAnchorin HERE Map Content Data Specification. Actual creating of geometry is implemented inSpeedLimitsTileclass. It accepts decoded speed limits data from datasource and creates line geometries increateRoadGeometriesmethod. In this method you can see a call togetSegmentAnchorCoordinatesmethod of data provider. It returns an array of geographical coordinate[long; lat]pairs which are then projected to world coordinates usingMapView's projection. Please note thatgetSegmentAnchorCoordinatesis asynchronous - it returns a promise which resolves with coordinates array. Corresponding technique is picked according to speed limit value so roads with different limits will have different colors. Final geometry is then generated from these coordinates and technique.SegmentAnchorGeometryDataProvidercan also be used by external rendering plugins of GeoJSON datasource to visualize custom data mapped to RIB road topology. There is an example of using geometry data provider in rendering plugins. There are also two other road geometry data providers -OmvRoadSegmentsDataProviderandRibRoadSegmentsDataProviderwhich are used by traffic datasource fromolp-traffic-datasourcepackage. They work in somewhat different way - return all road segment for a certain tile. The first one gets road information from OMV catalogs while the latter one retrieves data from HERE Map Contents road topology layer. It is preferable to use HERE Map Contents-based data provider because it has smaller memory footprint, performance overhead, and provides full road segments. (OMV data may have partial segments.)*/} Changelog API reference
Updated 2 months ago