How to use HERE content bindings
The HERE Content package offers high level content bindings which allow you to more easily extract and manipulate HERE content. Currently, these content bindings are offered for the following layers in the HERE Map Content catalog:
- ADAS Attributes
- Administrative Locations
- Administrative Places
- Advanced Navigation Attributes
- Navigation Attributes
- Road Attributes
- Street Names
- Topology & Geometry
- Traffic Patterns
The following tables list currently supported layers and attributes.
Single layer attributes
| Layer ID | Supported Attributes |
|---|---|
| topology-geometry | nodes, segments |
| topology-attributes | access_permission, access_restriction, accessible_by, black_spot, construction_status, display_level, environmental_zone_condition, functional_class, gate, grade_category, intersection_category, iso_country_code, junction_divider, lane_category, local_road, low_mobility, low_speed_zone, motorcycle_restriction, overpass_underpass, overtaking_restriction, permitted_driving_manoeuvre, physical, physical_lane_count, political_view_action, protected_overtaking, railway_crossing, recreational_vehicle_restriction, restricted_driving_manoeuvre, road_class, road_divider, road_usage, scenic, short_construction_warning, special_explication, special_speed_situation, special_traffic_area_category, speed_category, speed_limit, supplemental_geometry, through_lane_count, through_route, toll_structure, traffic_message_channel_code, traffic_sign, traffic_signal, transport_protocol_expert_group, travel_direction, urban, usage_fee_required, variable_speed_limit, variable_speed_sign, vehicle_checkpoint |
| adas-attributes | curvature_heading, slope, elevation, built_up_area_road, link_accuracy |
| address-attributes | postal_code, administrative_context_attribute, address_range, street_section |
| street-names | street_section, administrative_context |
| administrative-places | place |
| administrative-locations | location |
| environmental-zones | environmental_zone |
| traffic-patterns | traffic_pattern, holiday_pattern |
Multi layer attributes
| Layer IDs | Supported Attributes |
|---|---|
| address-attributes, administrative-places, administrative-locations | administrative boundaries |
| address-attributes, street-names | street names |
| topology-attributes, environmental-zones | environmental zones |
The accessor methods for all layers are similar. Below example illustrates the pattern by extracting functional class values from the Road Attributes layer.
Please see the API documentation and the tutorial notebook named
FunctionalClassCurvatureAnalysis_hmc.ipynb for additional detail.
Extract attributes within given partition
from here.content.hmc2 import HMC
from here.platform import Platform
# create HMC object
hmc = HMC(Platform())
# get attribute dictionary
atts = hmc.road_attributes.get("23618402", "functional_class")
print(atts){'here:cm:segment:209900713': {1: [<here.content.hmc.baseattributes.RangedAttribute at 0x1f8d1102790>,
<here.content.hmc.baseattributes.RangedAttribute at 0x1f8d11028e0>,
<here.content.hmc.baseattributes.RangedAttribute at 0x1f8d1102940>,
<here.content.hmc.baseattributes.RangedAttribute at 0x1f8d11029a0>,
<here.content.hmc.baseattributes.RangedAttribute at 0x1f8d1102a00>,
....Extract attributes within given partition to a DataFrame
from here.platform import Platform
from here.content.hmc2.hmc import HMC
from here.geopandas_adapter import GeoPandasAdapter
# create HMC object
hmc = HMC(Platform(adapter=GeoPandasAdapter()))
# extract attributes to DataFrame
df = hmc.road_attributes.get("23618402", "functional_class")
df.head(5)| partitionId | segmentId | direction | start_offset | end_offset | attribute | |
|---|---|---|---|---|---|---|
| 0 | 23618402 | here:cm:segment:209900713 | 1 | 0 | 0.255147 | functional_class: FUNCTIONAL_CLASS_1 |
| 1 | 23618402 | here:cm:segment:209900713 | 1 | 0.255147 | 0.395064 | functional_class: FUNCTIONAL_CLASS_1 |
| 2 | 23618402 | here:cm:segment:209900713 | 1 | 0.395064 | 0.481648 | functional_class: FUNCTIONAL_CLASS_1 |
| 3 | 23618402 | here:cm:segment:209900713 | 1 | 0.481648 | 0.555283 | functional_class: FUNCTIONAL_CLASS_1 |
| 4 | 23618402 | here:cm:segment:209900713 | 1 | 0.555283 | 0.58338 | functional_class: FUNCTIONAL_CLASS_1 |
When using HMC content bindings together with GeoPandasAdapter, the returned
DataFrame will contain rows only for those partitions that actually contain
requested data. In cases where get_attribute is called with non-existing or
empty partitions, an empty DataFrame will be returned.
Updated last month