You can read map tile data from the HERE HD Live Map[1]
(HERE HDLM) web service by using a hereHDLMReader
object and the read
function. This data is composed of a series of map layer objects. The diagram shows the
layers available for map tiles corresponding to a driving route in North America.
You can use this map layer data for a variety of automated driving applications. You can
also visualize certain layers by using the plot
function.
To read map data using the read
function, you must specify a
hereHDLMReader
object as an input argument. This object specifies
the map tiles from which you want to read data.
Create a hereHDLMReader
object that can read data from the map tiles
of a driving route in North America. Configure the reader to read data from only the
North America catalog by specifying a hereHDLMConfiguration
object for the Configuration
property of the reader. If you have not previously entered HERE HDLM credentials, a
dialog box prompts you to enter them. For reference, display the driving route on a
geographic axes.
route = load(fullfile(matlabroot,'examples','driving','geoSequenceNatickMA.mat')); lat = route.latitude; lon = route.longitude; config = hereHDLMConfiguration('North America'); reader = hereHDLMReader(lat,lon,'Configuration',config); geoplot(lat,lon,'bo-'); geobasemap('streets') title('Driving Route')
For more details about configuring a HERE HDLM reader, see Create Configuration for HERE HD Live Map Reader. For more details about creating a reader, see Create HERE HD Live Map Reader.
To read map layer data from the HERE HDLM web service, call the
read
function with the reader you created in the previous
section and the name of the map layer you want to read. For example, read data from the
layer containing the topology geometry of the road. The data is returned as an array of
map layer objects.
topology = read(reader,'TopologyGeometry')
topology = 2×1 TopologyGeometry array with properties: Data: HereTileId IntersectingLinkRefs LinksStartingInTile NodesInTile TileCenterHere2dCoordinate Metadata: Catalog CatalogVersion
Each map layer object corresponds to a map tiles that you selected using the input
hereHDLMReader
object. The IDs of these map tiles are stored in the
TileIds
property of the HERE HDLM reader.
Inspect the properties of the map layer object for the first map tile. Your catalog version might differ from the one shown here.
topology(1)
ans = TopologyGeometry with properties: Data: HereTileId: 321884279 IntersectingLinkRefs: [38×1 struct] LinksStartingInTile: [490×1 struct] NodesInTile: [336×1 struct] TileCenterHere2dCoordinate: [42.3083 -71.3782] Metadata: Catalog: 'here-hdmap-ext-na-1' CatalogVersion: 2066
The properties of the TopologyGeometry
layer object correspond to
valid HERE HDLM fields for that layer. In these layer objects, the names of the layer
fields are modified to fit the MATLAB® naming convention for object properties. For each layer field name, the
first letter and first letter after each underscore are capitalized and the underscores
are removed. This table shows sample name changes.
HERE HDLM Layer Fields | MATLAB Layer Object Property |
---|---|
here_tile_id | HereTileId |
tile_center_here_2d_coordinate | TileCenterHere2dCoordinate |
nodes_in_tile | NodesInTile |
The layer objects are MATLAB structures whose properties correspond to structure
fields. To access data from these fields, use dot notation. For example, this code
selects the NodeId
subfield from the
NodeAttribution
field of a
layer:
layerData.NodeAttribution.NodeId
This table summarizes the valid types of layer objects and their top-level data fields. The available layers are for the
Road Centerline Model and HD Lane Model. For an overview of HERE HDLM layers and the models that they belong to, see HERE HD Live Map Layers. For a full description of the fields, see HD Live Map Data Specification on the HERE Technologies website.
Layer Object | Description | Top-Level Data Fields (Layer Object Properties) | Plot Support |
---|---|---|---|
AdasAttributes | Precision geometry measurements, such as slope, elevation, and curvature of roads. Use this data to develop advanced driver assistance systems (ADAS). |
| Not available |
ExternalReferenceAttributes | References to external map links, nodes, and topologies for other HERE maps. |
| Not available |
LaneAttributes | Lane-level attributes, such as direction of travel and lane type. |
| Not available |
LaneGeometryPolyline | 3-D lane geometry composed of a set of 3-D points joined into polylines. |
| Available — Use the |
LaneRoadReferences | Road and lane group references and range information. Use this data to translate positions between the Road Centerline Model and the HD Lane Model. |
| Not available |
LaneTopology | Topologies of the HD Lane model, including lane group, lane group connector, lane, and lane connector topologies. This layer also contains the simplified 2-D boundary geometry of the lane model for determining map tile affinity and overflow. |
| Available — Use the |
RoutingAttributes | Road attributes related to navigation and conditions. These attributes are mapped parametrically to the 2-D polyline geometry in the topology layer. |
| Not available |
RoutingLaneAttributes | Core navigation lane attributes and conditions, such as the number of lanes in a road. These values are mapped parametrically to 2-D polylines along the road links. |
| Not available |
SpeedAttributes | Speed-related road attributes, such as speed limits. These attributes are mapped to the 2-D polyline geometry of the topology layer. |
| Not available |
TopologyGeometry | Topology and 2-D line geometry of the road. This layer also contains definitions of the nodes and links in the map tile. |
| Available — Use the |
You can visualize the data of certain map layers. To visualize these layers, use the
plot
function. Plot the topology geometry of the returned map layers. The plot shows the
boundaries, nodes (intersections and dead-ends), and links (streets) within the map
tiles. If a link extends past the tile boundary, the layer data includes that
link.
plot(topology)
Map layer plots are returned on a geographic axes. To customize map displays, you can use the properties of the geographic axes. For more details, see GeographicAxes Properties. Overlay the driving route on the plot.
hold on geoplot(lat,lon,'bo-','DisplayName','Route'); hold off
hereHDLMReader
| plot
| read
[1] You need to enter into a separate agreement with HERE in order to gain access to the HDLM services and to get the required credentials (app_id and app_code) for using the HERE Service.