Skip to content

Factory

StacGeneratorFactory

StacGeneratorFactory provides a factory method for getting configs and generating CollectionGenerator

get_extension_config_handler(extension) staticmethod

Match file extension with SourceConfig type

get_extension_handler(extension) staticmethod

Match file extension with SourceConfig type

register_extension_handler(extension, handler, force=False) staticmethod

Dynamically register extension handler

register_generator_handler(config_type, handler, force=False) staticmethod

Dynamically register a customer ItemGenerator class based on (new/existing) config type. Use force to overwrite existing handler

get_generator_handler(config) staticmethod

Match ItemGenrator class based on config type

extract_item_config(item) staticmethod

Get stac_generator properties. Used by the MCCN engine

get_collection_generator(source_configs, collection_config, pool=None) staticmethod

Get a CollectionGenerator instance based on source configs and collection config

Source configs can be given as
  • a string path to a config.json file
  • a list of string paths to different config.json files
  • an instance of SourceConfig class (VectorConfig, PointConfig, RasterConfig), etc
  • a list of instances of SourceConfig.
  • a dictionary that follows the general structure of a SourceConfig class
  • a list of dictionaries If file paths are given, the files will be parsed into instances of SourceConfig. If dictionaries are given, they will be parsed into istances of SourceConfig using pydantic model_valiate.

Parameters:

Name Type Description Default
source_configs Config_T

extra metadata/generation parameters for the collection's items

required
collection_config StacCollectionConfig

collection metadata.

required
pool Executor | None

optional threadpool/process pool for parallel processing.. Defaults to None.

None

Returns:

Name Type Description
CollectionGenerator CollectionGenerator

a collection generator instance, in which all items are derived from source _configs and general metadata derived from collection_config.