This module contains a DataQueryApi class to perform API operations.

The HERE API reference documentation used in this module can be found here: Query API Reference # noqa E501

class here.platform.api.data_query_api.DataQueryApi(base_url: str, platform_config: PlatformConfig, application_config: ApplicationConfig, auth: Auth | None, proxies: dict | None = None)[source]#

Bases: BaseApi

This class provides access to HERE platform Data Query APIs.

The query service provides a way to get information (metadata) about layers and partitions stored in a catalog. This service exposes the metadata for single partitions that users can query one by one or by specifying a parent tile.

get_changes_by_id(layer_id: str, partition: list, start_version: int | None = None, end_version: int | None = None, since_time: int | None = None, additional_fields: list | None = ['dataSize', 'checksum', 'compressedDataSize', 'crc'], billing_tag: str | None = None) dict[source]#

Get changes for the version or time range for the specific partition(s).

Parameters:
  • layer_id – Unique layer id. Content of this parameter refers to a valid layer ID.

  • partition – The partitions you want to include in the response. This allows you to limit the response to specific partitions. You can specify multiple partitions by using this parameter multiple times. The maximum number of partitions per call is 100.

  • start_version – Available/Required for versioned layers only; the beginning of the range of versions you want to get (exclusive). By convention -1 indicates the initial version before the first publication. After the first publication,the catalog version is 0

  • end_version – Available/Required for versioned layers only; the end of the range of versions you want to get (inclusive). This must be a valid catalog version greater than the startVersion.

  • since_time – Available/Required for volatile layers only; will return partitions whose data has been modified since this time, in milliseconds since epoch, inclusive.

  • additional_fields – Available values : dataSize, checksum, compressedDataSize, crc

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.

get_partitions_by_id(layer_id: str, partition: list, version: int | None = None, additional_fields: list | None = ['dataSize', 'checksum', 'compressedDataSize', 'crc'], billing_tag: str | None = None) dict[source]#

Get metadata for specific partition ids. If the layer specified in the request does not exist, the request results in an error. If a partition specified in the request does not exist, the response does not include this partition. Maximum allowed number of partitions ids per call is 100.

Parameters:
  • layer_id – The ID of the layer specified in the request. The content of this parameter must refer to a valid layer already configured in the catalog configuration. You can specify multiple partitions by using this parameter multiple times.

  • partition – Partition ids to use for filtering. You can specify multiple partitions by using this parameter multiple times. Maximum allowed partitions ids per call is 100

  • version – The version of the catalog against which to run the query. Must be a valid catalog version.

  • additional_fields – Additional fields - dataSize, checksum, compressedDataSize, crc.

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.

quad_tree_index(layer_id: str, version: int, quad_key: str, depth: int, additional_fields: list | None = ['dataSize', 'checksum', 'compressedDataSize', 'crc'], billing_tag: str | None = None) dict[source]#

Get metadata for the requested index. Only available for versioned layers where the partitioning scheme is heretile.

Parameters:
  • layer_id – The ID of the layer specified in the request. Content of this parameter must refer to a valid layer already configured in the catalog configuration. Exactly one layer ID must be provided.

  • version – The version of the catalog against which to run the query. Must be a valid catalog version.

  • quad_key – The geometric area specified by an index in the request, represented as a HERE tile.

  • depth – The recursion depth of the response. If set to 0, the response includes only data for the quadKey specified in the request. In this way, depth describes the maximum length of the subQuadKeys in the response. The maximum allowed value for the depth parameter is 4.

  • additional_fields – Additional fields - dataSize, checksum, compressedDataSize, crc.

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.

quad_tree_index_volatile(layer_id: str, quad_key: str, depth: int, additional_fields: list | None = ['dataSize', 'checksum', 'compressedDataSize', 'crc'], billing_tag: str | None = None) dict[source]#

Get metadata for the requested index. Only available for volatile layers where the partitioning scheme is heretile.

Parameters:
  • layer_id – The ID of the layer specified in the request. Content of this parameter must refer to a valid layer already configured in the catalog configuration. Exactly one layer ID must be provided.

  • quad_key – The geometric area specified by an index in the request, represented as a HERE tile.

  • depth – The recursion depth of the response. If set to 0, the response includes only data for the quadKey specified in the request. In this way, depth describes the maximum length of the subQuadKeys in the response. The maximum allowed value for the depth parameter is 4.

  • additional_fields – Additional fields - dataSize, checksum, compressedDataSize, crc.

  • billing_tag – A string which is used for grouping billing records.

Returns:

response from the API.

Raises:

PlatformException – If platform responds with an HTTP error.