1.2.2. tds2stac.creator module#

class tds2stac.creator.STACCreator[source]#

Bases: object

A class for creating STAC catalog, -Collections and its -Items from TDS datasets catalogs.

STACCatalog(url: str, stac_id: str, stac_title: str | None, stac_desc: str | None, stac_dir: str, stac_existence: bool = False, logger_properties: dict = {}, requests_properties: dict = {})[source]#

A function for creating STAC catalog from TDS dataset catalog.

Parameters:
  • url – The URL of the TDS catalog.

  • stac_id – The ID of the STAC catalog.

  • stac_title – The title of the STAC catalog.

  • stac_desc – The description of the STAC catalog.

  • stac_dir – The directory of saving the STAC catalog.

  • stac_existence – If it is True, it means that the STAC catalog already exists in the directory and for the harvesting, there is no need to create a new STAC-Catalog and import new collections In the existed STAC-Catalog. False by default.

  • logger_properties – The properties of the logger. For more information please check the Logger class.

  • requests_properties – The properties of the requests. For more information please check the requests_properties class.

STACCollection(catalog: Catalog, collection_id: str, collection_title: str, collection_description: str, stac_existence_collection: bool = False, logger_properties: dict = {}, extra_metadata: dict = {})[source]#

This is a function for creating STAC collection from harvested information from TDS dataset catalog. This function returns a dictionary with two keys:

  1. collection: The STAC collection

2. existed_items_id_list: The list of the items that already exist in the STAC collection and it is going to be used for the harvesting process.

Parameters:
  • catalog – The STAC catalog.

  • collection_id – The ID of the STAC collection.

  • collection_title – The title of the STAC collection.

  • collection_description – The description of the STAC collection.

  • collection_scientific – The scientific extension of the STAC collection.

  • stac_existence_collection – If it is True, it means that the STAC collection already exists in the catalog and for the harvesting, there is no need to create a new STAC-Collection and import new items In the existed STAC-Collection. False by default.

  • logger_properties – The properties of the logger. For more information please check the Logger class.

STACItem(url: str, catalog: Catalog, harvesting_vars: dict, Recognizer_output: str | None, collection_id: str, aggregated_dataset_url: str | None = None, extension_properties: dict | None = None, asset_properties: dict | None = {}, logger_properties: dict = {}, extra_metadata: dict = {}, stac_existence_collection: bool = False, collection_bbox_existed: list | None = None, collection_interval_time_final_existed: list | None = None)[source]#

This is a function for creating STAC item from harvested data in TDS dataset catalog.

Parameters:
  • url – The URL of the TDS catalog.

  • catalog – The STAC catalog.

  • harvesting_vars – The harvested data from TDS catalog.

  • Recognizer_output – The output of the Recognizer class.

  • collection_id – The ID of the STAC collection.

  • aggregated_dataset_url – The URL of the aggregated dataset that whole of data is located there.

  • extension_properties – The properties of the extensions.

  • asset_properties – The properties of the assets.

  • logger_properties – The properties of the logger. For more information please check the Logger class.

SaveCatalog(catalog, catalog_dir, logger_properties: dict = {})[source]#