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.
- 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).
- class pystac.extensions.datacube.AssetDatacubeExtension(asset: pystac.asset.Asset)[source]#
Bases:
pystac.extensions.datacube.DatacubeExtension
[pystac.asset.Asset
]A concrete implementation of
DatacubeExtension
on anAsset
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 anAsset
to extend it.
- class pystac.extensions.datacube.CollectionDatacubeExtension(collection: pystac.collection.Collection)[source]#
Bases:
pystac.extensions.datacube.DatacubeExtension
[pystac.collection.Collection
]A concrete implementation of
DatacubeExtension
on anCollection
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 anCollection
to extend it.- collection: pystac.collection.Collection#
- 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
, orAsset
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 theDatacubeExtension.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
orAsset
.
- 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
orAsset
.- Raises
pystac.ExtensionTypeError – If an invalid object type is passed.
- 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'}#
- 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
- 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.
- 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.
- class pystac.extensions.datacube.HorizontalSpatialDimensionAxis(value)[source]#
Bases:
pystac.utils.StringEnum
Allowed values for
axis
field ofHorizontalSpatialDimension
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 anItem
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 anItem
to extend it.- item: pystac.item.Item#
- 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.
- property step: Optional[str]#
The space between the temporal instances as ISO 8601 duration, e.g. P1D. Use null for irregularly spaced steps.
- 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
- 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
orauxiliary
- 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.
- 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.
- class pystac.extensions.datacube.VerticalSpatialDimensionAxis(value)[source]#
Bases:
pystac.utils.StringEnum
Allowed values for
axis
field ofVerticalSpatialDimension
object.- Z = 'z'#