pystac.extensions.datacube#

Implements the Datacube Extension.

class pystac.extensions.datacube.AdditionalDimension(properties: dict[str, Any])[source]#
clear_step() None[source]#

Setting step to None sets it to the null value, which means irregularly spaced steps. Use clear_step to remove it from the properties.

property extent: list[float | None] | None#

If the dimension consists of ordinal values, the extent (lower and upper bounds) of the values as two-dimensional array. Use null for open intervals.

property reference_system: str | float | dict[str, Any] | None#

The reference system for the data.

property step: float | None#

If the dimension consists of interval values, the space between the values. Use null for irregularly spaced steps.

property unit: str | None#

The unit of measurement for the data, preferably compliant to UDUNITS-2 units (singular).

property values: list[str] | list[float] | None#

A set of all potential values, especially useful for nominal values.

class pystac.extensions.datacube.AssetDatacubeExtension(asset: Asset)[source]#

A concrete implementation of DatacubeExtension on an Asset that extends the Asset fields to include properties defined in the Datacube Extension.

This class should generally not be instantiated directly. Instead, call EOExtension.ext() on an Asset to extend it.

asset_href: str#
properties: dict[str, Any]#

The properties that this extension wraps.

The extension which implements PropertiesExtension can use _get_property and _set_property to get and set values on this instance. Note that _set_properties mutates the properties directly.

class pystac.extensions.datacube.CollectionDatacubeExtension(collection: Collection)[source]#

A concrete implementation of DatacubeExtension on an Collection that extends the properties of the Item to include properties defined in the Datacube Extension.

This class should generally not be instantiated directly. Instead, call DatacubeExtension.ext() on an Collection to extend it.

collection: pystac.Collection#
properties: dict[str, Any]#

The properties that this extension wraps.

The extension which implements PropertiesExtension can use _get_property and _set_property to get and set values on this instance. Note that _set_properties mutates the properties directly.

class pystac.extensions.datacube.DatacubeExtension[source]#

An abstract class that can be used to extend the properties of a Collection, Item, or Asset with properties from the Datacube Extension. This class is generic over the type of STAC Object to be extended (e.g. Item, Asset).

To create a concrete instance of DatacubeExtension, use the DatacubeExtension.ext() method. For example:

>>> item: pystac.Item = ...
>>> dc_ext = DatacubeExtension.ext(item)
apply(dimensions: dict[str, Dimension], variables: dict[str, Variable] | None = None) None[source]#

Applies Datacube Extension properties to the extended Collection, Item or Asset.

Parameters:
  • dimensions – Dictionary mapping dimension name to Dimension objects.

  • variables – Dictionary mapping variable name to a Variable object.

property dimensions: dict[str, Dimension]#

A dictionary where each key is the name of a dimension and each value is a Dimension object.

classmethod ext(obj: T, add_if_missing: bool = False) DatacubeExtension[T][source]#

Extends the given STAC Object with properties from the Datacube Extension.

This extension can be applied to instances of Collection, Item or Asset.

Raises:

pystac.ExtensionTypeError – If an invalid object type is passed.

classmethod get_schema_uri() str[source]#

Gets the schema URI associated with this extension.

name: Literal['cube'] = 'cube'#
property variables: dict[str, Variable] | None#

A dictionary where each key is the name of a variable and each value is a Variable object.

class pystac.extensions.datacube.DatacubeExtensionHooks[source]#
prev_extension_ids = {'datacube', 'https://stac-extensions.github.io/datacube/v1.0.0/schema.json', 'https://stac-extensions.github.io/datacube/v2.0.0/schema.json', 'https://stac-extensions.github.io/datacube/v2.1.0/schema.json'}#
schema_uri: str = 'https://stac-extensions.github.io/datacube/v2.2.0/schema.json'#
stac_object_types = {Collection, Feature}#
class pystac.extensions.datacube.Dimension(properties: dict[str, Any])[source]#

Object representing a dimension of the datacube. The fields contained in Dimension Object vary by type. See the Datacube Dimension Object docs for details.

property description: str | None#

Detailed multi-line description to explain the dimension. CommonMark 0.29 syntax MAY be used for rich text representation.

property dim_type: DimensionType | str#

The type of the dimension. Must be "spatial" for Horizontal Spatial Dimension Objects or Vertical Spatial Dimension Objects, geometries for Spatial Vector Dimension Objects "temporal" for Temporal Dimension Objects. May be an arbitrary string for Additional Dimension Objects.

static from_dict(d: dict[str, Any]) Dimension[source]#
properties: dict[str, Any]#
to_dict() dict[str, Any][source]#
class pystac.extensions.datacube.DimensionType(value)[source]#

Dimension object types for spatial and temporal Dimension Objects.

GEOMETRIES = 'geometries'#
SPATIAL = 'spatial'#
TEMPORAL = 'temporal'#
class pystac.extensions.datacube.HorizontalSpatialDimension(properties: dict[str, Any])[source]#
property axis: HorizontalSpatialDimensionAxis#

Axis of the spatial dimension. Must be one of "x" or "y".

class pystac.extensions.datacube.HorizontalSpatialDimensionAxis(value)[source]#

Allowed values for axis field of HorizontalSpatialDimension object.

X = 'x'#
Y = 'y'#
class pystac.extensions.datacube.ItemAssetsDatacubeExtension(item_asset: AssetDefinition)[source]#
asset_defn: item_assets.AssetDefinition#
properties: dict[str, Any]#

The properties that this extension wraps.

The extension which implements PropertiesExtension can use _get_property and _set_property to get and set values on this instance. Note that _set_properties mutates the properties directly.

class pystac.extensions.datacube.ItemDatacubeExtension(item: Item)[source]#

A concrete implementation of DatacubeExtension on an Item that extends the properties of the Item to include properties defined in the Datacube Extension.

This class should generally not be instantiated directly. Instead, call DatacubeExtension.ext() on an Item to extend it.

item: pystac.Item#
properties: dict[str, Any]#

The properties that this extension wraps.

The extension which implements PropertiesExtension can use _get_property and _set_property to get and set values on this instance. Note that _set_properties mutates the properties directly.

class pystac.extensions.datacube.SpatialDimension(properties: dict[str, Any])[source]#
clear_step() None[source]#

Setting step to None sets it to the null value, which means irregularly spaced steps. Use clear_step to remove it from the properties.

property extent: list[float]#

Extent (lower and upper bounds) of the dimension as two-dimensional array. Open intervals with None are not allowed.

property reference_system: str | float | dict[str, Any] | None#

The spatial reference system for the data, specified as numerical EPSG code, WKT2 (ISO 19162) string or PROJJSON object. Defaults to EPSG code 4326.

property step: float | None#

The space between the values. Use None for irregularly spaced steps.

property values: list[float] | None#

Optional set of all potential values.

class pystac.extensions.datacube.TemporalDimension(properties: dict[str, Any])[source]#
clear_step() None[source]#

Setting step to None sets it to the null value, which means irregularly spaced steps. Use clear_step to remove it from the properties.

property extent: list[str | None] | None#

Extent (lower and upper bounds) of the dimension as two-dimensional array. The dates and/or times must be strings compliant to ISO 8601. None is allowed for open date ranges.

property step: str | None#

The space between the temporal instances as ISO 8601 duration, e.g. P1D. Use null for irregularly spaced steps.

property values: list[str] | None#

If the dimension consists of set of specific values they can be listed here. The dates and/or times must be strings compliant to ISO 8601.

class pystac.extensions.datacube.Variable(properties: dict[str, Any])[source]#

Object representing a variable in the datacube. The dimensions field lists zero or more Datacube Dimension Object instances. See the Datacube Variable Object docs for details.

property description: str | None#

Detailed multi-line description to explain the variable. CommonMark 0.29 syntax MAY be used for rich text representation.

property dimensions: list[str]#

The dimensions of the variable. Should refer to keys in the cube:dimensions object or be an empty list if the variable has no dimensions

property extent: list[float | str | None]#

If the variable consists of ordinal values <https://en.wikipedia.org/wiki/Level_of_measurement#Ordinal_scale>, the extent (lower and upper bounds) of the values as two-dimensional array. Use None for open intervals

static from_dict(d: dict[str, Any]) Variable[source]#
properties: dict[str, Any]#
to_dict() dict[str, Any][source]#
property unit: str | None#

The unit of measurement for the data, preferably compliant to UDUNITS-2 <https://ncics.org/portfolio/other-resources/udunits2/> units (singular)

property values: list[float | str] | None#

A set of all potential values, especially useful for nominal values <https://en.wikipedia.org/wiki/Level_of_measurement#Nominal_level>.

property var_type: VariableType | str#

Type of the variable, either data or auxiliary

class pystac.extensions.datacube.VariableType(value)[source]#

Variable object types

AUXILIARY = 'auxiliary'#
DATA = 'data'#
class pystac.extensions.datacube.VectorSpatialDimension(properties: dict[str, Any])[source]#
property axes: list[str] | None#

Axes of the vector dimension as an ordered set of x, y and z.

property bbox: list[float]#

A single bounding box of the geometries as defined for STAC Collections but not nested.

property geometry_types: list[str] | None#

A set of geometry types. If not present, mixed geometry types must be assumed.

property reference_system: str | float | dict[str, Any] | None#

The reference system for the data.

property values: list[str] | None#

Optionally, a representation of the geometries. This could be a list of WKT strings or other identifiers.

class pystac.extensions.datacube.VerticalSpatialDimension(properties: dict[str, Any])[source]#
property axis: VerticalSpatialDimensionAxis#

Axis of the spatial dimension. Must be "z".

property unit: str | None#

The unit of measurement for the data, preferably compliant to UDUNITS-2 units (singular).

class pystac.extensions.datacube.VerticalSpatialDimensionAxis(value)[source]#

Allowed values for axis field of VerticalSpatialDimension object.

Z = 'z'#