pystac.extensions.datacube#

Implements the Datacube Extension.

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

Bases: pystac.extensions.datacube.Dimension

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: Optional[List[Optional[float]]]#

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.

properties: Dict[str, Any]#
property reference_system: Optional[Union[str, float, Dict[str, Any]]]#

The reference system for the data.

property step: Optional[float]#

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

property unit: Optional[str]#

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

property values: Optional[Union[List[float], List[str]]]#

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

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

Bases: pystac.extensions.datacube.DatacubeExtension[pystac.asset.Asset]

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: pystac.collection.Collection)[source]#

Bases: pystac.extensions.datacube.DatacubeExtension[pystac.collection.Collection]

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.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(*args, **kwds)[source]#

Bases: Generic[pystac.extensions.datacube.T], pystac.extensions.base.PropertiesExtension, pystac.extensions.base.ExtensionManagementMixin[Union[pystac.collection.Collection, pystac.item.Item]]

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, pystac.extensions.datacube.Dimension], variables: Optional[Dict[str, pystac.extensions.datacube.Variable]] = None) None[source]#

Applies label extension properties to the extended Collection, Item or Asset.

Parameters
  • dimensions – Dictionary mapping dimension name to a Dimension object.

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

property dimensions: Dict[str, pystac.extensions.datacube.Dimension]#

Dictionary mapping dimension name to a Dimension object.

classmethod ext(obj: pystac.extensions.datacube.T, add_if_missing: bool = False) pystac.extensions.datacube.DatacubeExtension[pystac.extensions.datacube.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.

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.

property variables: Optional[Dict[str, pystac.extensions.datacube.Variable]]#

Dictionary mapping variable name to a Variable object.

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

Bases: pystac.extensions.hooks.ExtensionHooks

prev_extension_ids = {'datacube'}#
schema_uri: str = 'https://stac-extensions.github.io/datacube/v2.0.0/schema.json'#
stac_object_types = {STACObjectType.COLLECTION, STACObjectType.ITEM}#
class pystac.extensions.datacube.Dimension(properties: Dict[str, Any])[source]#

Bases: abc.ABC

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: Optional[str]#

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

property dim_type: Union[pystac.extensions.datacube.DimensionType, str]#

Horizontal Spatial Dimension Objects <datacube#horizontal-spatial-dimension-object> or Vertical Spatial Dimension Objects, and "temporal" for Temporal Dimension Objects. May be an arbitrary string for Additional Dimension Objects.

Type

The type of the dimension. Must be "spatial" for

Type

stac-ext

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

Bases: pystac.utils.StringEnum

Dimension object types for spatial and temporal Dimension Objects.

SPATIAL = 'spatial'#
TEMPORAL = 'temporal'#
class pystac.extensions.datacube.HorizontalSpatialDimension(properties: Dict[str, Any])[source]#

Bases: pystac.extensions.datacube.Dimension

property axis: pystac.extensions.datacube.HorizontalSpatialDimensionAxis#

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

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.

properties: Dict[str, Any]#
property reference_system: Optional[Union[str, float, Dict[str, Any]]]#

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: Optional[float]#

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

property values: Optional[List[float]]#

Optional set of all potential values.

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

Bases: pystac.utils.StringEnum

Allowed values for axis field of HorizontalSpatialDimension object.

X = 'x'#
Y = 'y'#
class pystac.extensions.datacube.ItemDatacubeExtension(item: pystac.item.Item)[source]#

Bases: pystac.extensions.datacube.DatacubeExtension[pystac.item.Item]

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.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.TemporalDimension(properties: Dict[str, Any])[source]#

Bases: pystac.extensions.datacube.Dimension

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: Optional[List[Optional[str]]]#

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.

properties: Dict[str, Any]#
property step: Optional[str]#

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

property values: Optional[List[str]]#

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]#

Bases: object

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: Optional[str]#

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[Optional[Union[float, str]]]#

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]) pystac.extensions.datacube.Variable[source]#
properties: Dict[str, Any]#
to_dict() Dict[str, Any][source]#
property unit: Optional[str]#

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

property values: Optional[List[Union[float, str]]]#

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

property var_type: Union[pystac.extensions.datacube.VariableType, str]#

Type of the variable, either data or auxiliary

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

Bases: pystac.utils.StringEnum

Variable object types

AUXILIARY = 'auxiliary'#
DATA = 'data'#
class pystac.extensions.datacube.VerticalSpatialDimension(properties: Dict[str, Any])[source]#

Bases: pystac.extensions.datacube.Dimension

property axis: pystac.extensions.datacube.VerticalSpatialDimensionAxis#

Axis of the spatial dimension. Always "z".

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: Optional[List[Optional[float]]]#

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.

properties: Dict[str, Any]#
property reference_system: Optional[Union[str, float, Dict[str, Any]]]#

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: Optional[float]#

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

property unit: Optional[str]#

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

property values: Optional[Union[List[float], List[str]]]#

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

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

Bases: pystac.utils.StringEnum

Allowed values for axis field of VerticalSpatialDimension object.

Z = 'z'#