here.content.hmc2.place_context

Source code for here.content.hmc2.place_context

Copyright (C) 2021-2022 HERE Global B.V. and its affiliate(s).

All rights reserved.

This software and other materials contain proprietary information

controlled by HERE and are protected by applicable copyright legislation.

Any use and utilization of this software and other materials and

disclosure to any third parties is conditional upon having a separate

agreement with HERE for the access, use, utilization or disclosure of this

software. In the absence of such agreement, the use of the software is not

allowed.

"""
Bindings for the HMC Administrative Places.
"""
from dataclasses import dataclass
from typing import List

from here.content.base import ContentIndexer
from here.platform.adapter import Ref

[docs]
@dataclass
class PlaceClassification:
"""How a place is classified."""

preference: str
place_ref: Ref

[docs]
@dataclass
class PlaceContext:
"""The administrative contexts that bounds places together."""

classification_type: str
city: List[PlaceClassification]
postal_code: List[PlaceClassification]
country: List[PlaceClassification]
state: List[PlaceClassification]
region: List[PlaceClassification]
county: List[PlaceClassification]
district: List[PlaceClassification]
sub_district: List[PlaceClassification]
further_zone: List[PlaceClassification]
default_mapping: int
political_view: List[str]
political_view_exception: List[str]

no indexing by ids, contexts don't have own ids

it might be useful to add indexing by ref, for each admin type

indexer = ContentIndexer()