This module extends the functionality of the STAC client, enriching returned objects with additional features.
View repositoryThis PySTAC class is extended with the file
property to access signed URLs of assets and download them.
Extended properties
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("."))
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
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()
This PySTAC class is extended with the up42
property to access data from UP42 extensions.
A class that defines a namespace to access data from UP42 STAC extensions.
Attributes
Attribute | Description |
---|---|
title | str Refers to the up42-user:title property. |
tags | str Refers to the up42-user:tags property. |
product_id | str Refers to the up42-product:product_id property. |
collection_name | str Refers to the up42-product:collection_name property. |
modality | str Refers to the up42-product:modality property. |
order_id | str Refers to the up42-order:order_id property. |
asset_id | str Refers to the up42-system:asset_id property. |
account_id | str Refers to the up42-system:account_id property. |
workspace_id | str Refers to the up42-system:workspace_id property. |
job_id | str Refers to the up42-system:job_id property. |
source | str Refers to the up42-system:source property. |
metadata_version | str Refers to the up42-system:metadata_version property. |