here.content.hmc2.base_attributes module

here.content.hmc2.base_attributes module

Common definition and helper functions for HMC attributes.

class here.content.hmc2.base_attributes.Attribute(segments: List[SegmentRef], forward: bool, backward: bool, attribute: DecodedMessage)
Bases: object

An attribute of a specific direction and sequence of segments where it applies

attribute: DecodedMessage

backward: bool

forward: bool

indexer = ContentIndexer(partition=None, identifier=None, refs={'first_segment':</span> <span class="pre"><function</span> <span class="pre">Attribute.<lambda>>,</span> <span class="pre">'segment':</span> <span class="pre"><function</span> <span class="pre">Attribute.<lambda>>})

segments: List[SegmentRef]

class here.content.hmc2.base_attributes.BaseAttributesBinding(content: Content, layer_id: str, adapter: Adapter | None = None, layer_type: LayerType | None = None)
Bases: SingleLayerBinding, ABC

Bindings for HCM road attributes.

classmethod parse_and_index(partition_id: str, msg: Message) ContentPartition
Parse and index decoded message.

Parameters:

  • partition_id – identifier of the partition

  • msg – decoded content from the layer, in the form of a Protobuf message

Returns:
the content of a partition parsed and indexed in its own data structure

class here.content.hmc2.base_attributes.BaseAttributesMultiLayerBinding(content: Content, layer_id: str, adapter: Adapter | None = None)
Bases: BaseAttributesBinding, ABC

Base Attributes Multilayer Binding Class

abstract classmethod associated_layers() Dict[str, SingleLayerBinding]
Return associating layers to the base layer defined in schema hrn.

Returns:
dict of key as single layer and value as SingleLayerBinding Object.

classmethod parse_and_index(partition_id: str, msg: Message) ContentPartition
Parse and index decoded message.

Parameters:

  • partition_id – identifier of the partition

  • msg – decoded content from the layer, in the form of a Protobuf message

Returns:
the content of a partition parsed and indexed in its own data structure

class here.content.hmc2.base_attributes.SegmentRef(ref: Ref, inverted: bool, offset: Range)
Bases: object

A reference to a specific direction and range of segment

inverted: bool

offset: Range

ref: Ref