GuidesTypeScript API ReferencePython v2 API Reference
Guides

How to perform layer operations

A layer contains semantically related data of same type and format. Layers are subdivided into smaller units called partitions which are reasonably-sized units for caching and processing. Partitions can store any binary data - it will be published and retrieved without modification. However, you can optionally define the structure and encoding of the data by associating a content type and schema with the layer.

The content type, such as application/geo+json, describes the encoding of the data stored in each partition according to internet standards. The schema, for content types that need one such as application/x-protobuf, defines the exact data structure for the partitions in the layer so that data producers and consumers know how to generate and interpret encoded data.

See the Data API for more information on layers and partitions.

The HERE Data SDK for Python allows for interaction with these layer types:

  • Versioned layer
  • Volatile layer
  • Index layer
  • Stream layer
  • Interactive Map layer
  • Object Store layer

Each layer type has its own usage and storage patterns, and separate classes with methods for that type. For information about all methods, see the layer module API documentation.

  • In the Read from Layer section following, you can find details on how to read data from each of the supported layer types.
  • For information on how to write data to each of these layer types, see the Write to Layer section.
  • For information on writing to multiple layers of a catalog simultaneously, see the Catalog Operations section.
  • For information on creating new and modifying existing layers, see Catalog Operations section.

Adapters

Adapters are used to encode and decode data and convert data between different representations, for example pandas DataFrame, geopandas GeoDataFrame, Python list and dict objects, GeoJSON objects of the geojson Python library. Additional adapters can be added in the future, or users can develop and use their own, to interface HERE Data SDK for Python to a variety of systems and content representations.

Included in the HERE Data SDK for Python there are the following adapters:

  • Default adapter, automatically used in case no other adapter is specified
  • GeoPandas Adapter

A default adapter is configured by default. Users can also specify a different adapter in various functions. However, not every adapter supports every content type and representation. It's always possible to specify the parameters encode=False or decode=False when reading or writing to disable encoding, decoding, and format transformation. In this case, data in the form of raw bytes is returned to the user when reading layers; similarly users have to provide already-encoded data when writing.

When streaming data downloads with stream=True, decoding will be implicitly disabled as if passing decode=False. In this situation data is returned as Iterator[bytes], where each chunk of bytes is requested as the iterator is traversed.

Supported formats

The following table summarizes the data formats currently supported natively by HERE Data SDK for Python, and via the use of additional data adapters.

Layer and content typeencode=False decode=FalseDefaultAdapterGeoPandasAdapter
Versioned Layer
anyread/write bytes
application/(x-)protobufread/write Messageread/write DataFrame
application/x-parquetread/write DataFrame
application/jsonread/write dict/listread/write DataFrame
application/(vnd.)geo+jsonread/write FeatureCollectionread/write GeoDataFrame
text/csvread/write List[dict]read/write DataFrame
Volatile Layer
anyread/write bytes
application/(x-)protobufread/write Messageread/write DataFrame
application/x-parquetread/write DataFrame
application/jsonread/write dict/listread/write DataFrame
application/(vnd.)geo+jsonread/write FeatureCollectionread/write GeoDataFrame
text/csvread/write List[dict]read/write DataFrame
Index Layer
anyread/write bytes
application/(x-)protobufread/write Messageread/write DataFrame
application/x-parquetread/write* DataFrame
application/jsonread/write dict/listread/write DataFrame
application/(vnd.)geo+jsonread/write FeatureCollectionread/write GeoDataFrame
text/csvread/write List[dict]read/write DataFrame
Stream Layer
anyread/write bytes
application/(x-)protobufread/write Messageread/write DataFrame
application/x-parquetread/write DataFrame
application/jsonread/write dict/listread/write DataFrame
application/(vnd.)geo+jsonread/write FeatureCollectionread/write GeoDataFrame
text/csvread/write List[dict]read/write DataFrame
Interactive Map Layer
application/(vnd.)geo+jsonread/write FeatureCollectionread/write GeoDataFrame
Object Store Layer
anyread/write bytes

(*) writing is supported for only one partition at a time