Schema
ASSET_KEY = 'data'
module-attribute
Constant describing the primary asset key
StacCollectionConfig
Bases: BaseModel
Contains parameters to pass to Collection constructor. Also contains other metadata except for datetime related metadata.
This config provides additional information that can not be derived from source file, which includes Stac Common Metadata and other descriptive information such as the id of the new entity
id
instance-attribute
Item id
title = 'Auto-generated Stac Item'
class-attribute
instance-attribute
A human readable title describing the item entity. See more
description = 'Auto-generated Stac Item'
class-attribute
instance-attribute
Detailed multi-line description to fully explain the STAC entity. See more
license = None
class-attribute
instance-attribute
License(s) of the data as SPDX License identifier, SPDX License expression, or other - See more
providers = None
class-attribute
instance-attribute
A list of providers, which may include all organizations capturing or processing the data or the hosting provider. Providers should be listed in chronological order with the most recent provider being the last element of the list. - See more
platform = None
class-attribute
instance-attribute
Unique name of the specific platform to which the instrument is attached. See more
instruments = None
class-attribute
instance-attribute
Name of instrument or sensor used (e.g., MODIS, ASTER, OLI, Canon F-1). See more
constellation = None
class-attribute
instance-attribute
Name of the constellation to which the platform belongs. See more
mission = None
class-attribute
instance-attribute
Name of the mission for which data is collected. See more
StacItemConfig
Bases: StacCollectionConfig
Contains parameters related to collection date, time and timezone.
A STAC Item's datetime field is derived from the combination of collection_date, collection_time and timezone.
If the asset contains a timeseries, in which some values are not timezone aware, the timestamp is embedded with timezone
information from the parameter timezone.
collection_date
instance-attribute
Date when the data is collected
collection_time
instance-attribute
Time when the data is collected
timezone = 'local'
class-attribute
instance-attribute
How timestamps associated with the Item is interpreted. If timezone is local, timezone information is derived from geometry. If timezone is a valid IANA timezone, non tz-aware timestamps will be embedded with timezone information. If an invalid timezone is provided, will raise an error.
get_datetime(geometry)
Method to derive item's datetime based on collection date, collection time, and potentially geometry
SourceConfig
Bases: StacItemConfig
Base source config that should be subclassed for different file extensions.
Source files contain raw spatial information (i.e. geotiff, shp, csv) from which some Stac metadata can be derived. SourceConfig describes:
- The access mechanisms for the source file: stored on local disk, or hosted somewhere behind an api endpoint. If the source file must be accessed through an endpoint, users can provide additional HTTP information that forms the HTTP request to the host server.
- Processing information that are unique for the source type. Users should inherit
SourceConfigfor file extensions currently unsupported. - Additional Stac Metadata from
StacConfig
location
instance-attribute
Asset's href
extension = None
class-attribute
instance-attribute
Explicit file extension specification. If the file is stored behind an api endpoint, the field extension must be provided
method = 'GET'
class-attribute
instance-attribute
HTTPMethod to acquire the file from location
params = None
class-attribute
instance-attribute
HTTP query params for getting file from location
headers = None
class-attribute
instance-attribute
HTTP query headers for getting file from location
cookies = None
class-attribute
instance-attribute
HTTP query cookies for getting file from location
content = None
class-attribute
instance-attribute
HTTP query body content for getting file from location
data = None
class-attribute
instance-attribute
HTTP query body content for getting file from location
json_body = None
class-attribute
instance-attribute
HTTP query body content for getting file from location
to_common_metadata()
Method to convert config to a python dictionary of common metadata excluding id
to_asset_config()
Abstract method that dictates how config should be serialised that contains the minimum information to intepret the asset. SourceConfig subclasses should inherit and override this method.
to_properties()
Method to convert config to properties dictionary to be added to Item's properties field. This
includes timezone attribute and stac_generator key value pairs derived from to_asset_config.
ColumnInfo
Bases: TypedDict
TypedDict description of GeoDataFrame columns. Used for describing vector/point attributes
name
instance-attribute
Column name
description
instance-attribute
Column description
dtype
instance-attribute
Column data type
HasColumnInfo
Bases: BaseModel
Mixin that provides column info field
column_info = Field(default_factory=list)
class-attribute
instance-attribute
List of attributes associated with point/vector data
VectorOwnConfig
Bases: HasColumnInfo
Config that defines the minimum information for parsing and reading vector asset.
This config is produced for vector asset when the method to_asset_config is invoked,
or when StacGeneratorFactory.extract_item_config is called on a vector STAC Item.
layer = None
class-attribute
instance-attribute
Vector layer for multi-layer shapefile.
join_config = None
class-attribute
instance-attribute
Config for join asset if valid available.
check_join_fields_described()
Validates that if join config is provided, the field left_on must be described by the vector's column_info. Also
validates that right_on must be described by the join config's column_info.
VectorConfig
Bases: SourceConfig, VectorOwnConfig
Extends SourceConfig to describe vector asset.
to_asset_config()
Produce a dictionary that has the signature of VectorOwnConfig
JoinConfig
Bases: BaseModel
Schema for join asset. This also contains information on how the vector asset and the join asset should be merged.
Merge terminologies are consistent with pandas', where the vector asset is treated as the left table, and the join asset is the right table.
file
instance-attribute
Path to asset. Must be a string or a Path.
left_on
instance-attribute
Vector asset's attribute for joining.
right_on
instance-attribute
Join asset's attribute for joining.
date_column = None
class-attribute
instance-attribute
Name of the attribute in the join asset to be treated as timestamps.
date_format = 'ISO8601'
class-attribute
instance-attribute
Format for intepreting timestamps. Accepted values follows strptime/strftime formats.
column_info
instance-attribute
List of join asset column attribute. Note that for join assset, this cannot be empty.
check_non_empty_column_info(value)
classmethod
Method to validate that column info is non empty
PointOwnConfig
Bases: HasColumnInfo
Source config for point(csv) data. This config is produced for point asset when the method to_asset_config is invoked, or when StacGeneratorFactory.extract_item_config is called on a point STAC Item.
X
instance-attribute
Column to be treated as longitude/X coordinate
Y
instance-attribute
Column to be treated as latitude/Y coordinate
Z = None
class-attribute
instance-attribute
Column to be treated as altitude/Z coordinate
T = None
class-attribute
instance-attribute
Column to be treated as time coordinate
date_format = 'ISO8601'
class-attribute
instance-attribute
Format to parse dates - will be used if T column is provided
epsg = 4326
class-attribute
instance-attribute
EPSG code
PointConfig
Bases: SourceConfig, PointOwnConfig
Extends SourceConfig to describe point asset.
to_asset_config()
Produce a dictionary that has the signature of PointOwnConfig
RasterOwnConfig
Bases: BaseModel
Config that defines the minimum information for parsing and reading raster asset. This config is produced for raster asset when the method to_asset_config is invoked, or when StacGeneratorFactory.extract_item_config is called on a raster STAC Item.
band_info
instance-attribute
List of band information - REQUIRED
RasterConfig
Bases: SourceConfig, RasterOwnConfig
Extends SourceConfig to describe raster asset.
to_asset_config()
Produce a dictionary that has the signature of RasterOwnConfig
BandInfo
Bases: BaseModel
Band information for raster data
name
instance-attribute
Band name. Will be converted to lower case for serialisation
common_name = None
class-attribute
instance-attribute
Band's common name. Users should only provide one of the supported names.
wavelength = None
class-attribute
instance-attribute
Band's wavelength
nodata = None
class-attribute
instance-attribute
Band's nodata value
data_type = None
class-attribute
instance-attribute
Band's data_type
description = None
class-attribute
instance-attribute
Band's description