GuidesTypeScript API ReferencePython v2 API Reference
Guides

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 IDSupported Attributes
topology-geometrynodes, segments
topology-attributesaccess_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-attributescurvature_heading, slope, elevation, built_up_area_road, link_accuracy
address-attributespostal_code, administrative_context_attribute, address_range, street_section
street-namesstreet_section, administrative_context
administrative-placesplace
administrative-locationslocation
environmental-zonesenvironmental_zone
traffic-patternstraffic_pattern, holiday_pattern

Multi layer attributes

Layer IDsSupported Attributes
address-attributes, administrative-places, administrative-locationsadministrative boundaries
address-attributes, street-namesstreet names
topology-attributes, environmental-zonesenvironmental 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)
partitionIdsegmentIddirectionstart_offsetend_offsetattribute
023618402here:cm:segment:209900713100.255147functional_class: FUNCTIONAL_CLASS_1
123618402here:cm:segment:20990071310.2551470.395064functional_class: FUNCTIONAL_CLASS_1
223618402here:cm:segment:20990071310.3950640.481648functional_class: FUNCTIONAL_CLASS_1
323618402here:cm:segment:20990071310.4816480.555283functional_class: FUNCTIONAL_CLASS_1
423618402here:cm:segment:20990071310.5552830.58338functional_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.