STAC in SDK

Use STAC functionalities of the SDK.


Overview

This module extends the functionality of the STAC client, enriching returned objects with additional features.

View repository

Class extension: pystac.Asset

This PySTAC class is extended with the file property to access signed URLs of assets and download them.

Extended properties

file

Accesses the asset file.

Python

    order_id_cql2 = {
    "op": "=",
    "args": [{"property": "order_id"}, order_id],
}
client = up42.stac_client()
item = next(client.search(filter=order_id_cql2).items())
overview = next(
    asset for asset in item.assets.values() if asset.roles == ["overview", "multispectral"]
)
overview.file.download(".")
# in Jupyter notebook
from IPython.display import Image
Image(overview.file.url)
# for larger files use local copy
Image(overview.file.download("."))

  

Class extension: pystac.Item

This PySTAC class is extended with the up42 property to access data from UP42 extensions and update method to save changes to title and tags.

Extended properties

up42

Accesses the UP42 extensions data.

Python

    order_id_cql2 = {
    "op": "=",
    "args": [{"property": "order_id"}, order_id],
}
client = up42.stac_client()
item = next(client.search(filter=order_id_cql2).items())
assert item.up42.collection_name == "phr"
item.up42.title = "new-title"
item.up42.tags = ["new", "tags"]
item.update()

  

Class extension: pystac.Collection

This PySTAC class is extended with the up42 property to access data from UP42 extensions.

Extended properties

up42

Accesses the UP42 extensions data.

Class: Up42Extension

A class that defines a namespace to access data from UP42 STAC extensions.

Attributes
AttributeDescription
titlestr
Refers to the up42-user:title property.
tagsstr
Refers to the up42-user:tags property.
product_idstr
Refers to the up42-product:product_id property.
collection_namestr
Refers to the up42-product:collection_name property.
modalitystr
Refers to the up42-product:modality property.
order_idstr
Refers to the up42-order:order_id property.
asset_idstr
Refers to the up42-system:asset_id property.
account_idstr
Refers to the up42-system:account_id property.
workspace_idstr
Refers to the up42-system:workspace_id property.
job_idstr
Refers to the up42-system:job_id property.
sourcestr
Refers to the up42-system:source property.
metadata_versionstr
Refers to the up42-system:metadata_version property.