pctasks.dataset.collection.Collection#

class pctasks.dataset.collection.Collection#

Base class for defining how Items in a Collection are created.

To create a Collection, subclass this class and implement the create_item method. You may also override the other methods, which define the tasks that create splits, create chunks, and creates items from the chunk files. However the defaults for those tasks should generally work, and you should normally only need to supply the create_item method.

If you’re working with a stactools package, this class can be as simple as calling out to the stactools package to create an Item from an asset.

Example:

class MyCollection(Collection):
def create_item(

self, asset_uri: str, storage_factory: StorageFactory

) -> Union[List[pystac.Item], WaitTaskResult]:

storage, asset_path = storage_factor.get_storage_for_file(asset_uri) signed_url = storage.get_authenticated_url(asset_path) item = stactools.mypackage.create_item(signed_url) return [item]

__init__()#

Methods

__init__()

create_chunks_task()

create_item(asset_uri, storage_factory)

Create an Item from the given asset_uri.

create_items_task()

create_splits_task()