Asset class

Retrieve and manage assets.


Overview

The Asset class enables access to assets in storage and their STAC information.

Python

    asset = up42.initialize_asset(asset_id="68567134-27ad-7bd7-4b65-d61adb11fc78")

  

Types of assets:

  • UP42 assets

    The original delivery you received in storage as a result of a completed tasking or catalog order.

  • STAC assets

    The cloud-native asset model format transforms an UP42 asset into individual geospatial features available for immediate download. These geospatial features are STAC assets. For example, multispectral and panchromatic products of an image acquired by an optical sensor, are different STAC assets.

    STAC assets are part of STAC items, individual scenes that have a unique spatiotemporal extent. STAC items are contained in STAC collections, objects that group related items and aggregate their summary metadata. STAC collections can be mapped to UP42 assets.

UP42 assets

info

The info attribute returns metadata of a specific UP42 asset. The returned data type is dict.

An example with info

Python

    asset.info

  

update_metadata()

The update_metadata() function allows you to change the title and tags of an UP42 asset. The returned data type is dict.

ArgumentOverview
titlestr
An editable asset title. If no value is provided, the current title will remain unchanged.
tagslist[str]
An editable list of tags to categorize the asset. A tag can consist of letters, numbers, spaces, and special characters (., -, _, /, :). If no value is provided, the current tags will remain unchanged.
An example with update_metadata()

Python

    asset.update_metadata(
    title="Sentinel-2 over Western Europe",
    tags=["optical", "WEU"],
)

  

download()

The download() function allows you to download UP42 assets from storage and returns a list of download paths. The returned data type is list[str].

ArgumentOverview
output_directoryUnion[str, Path, None]
The file output directory. The default value is the current directory.
unpackingbool
Determines how to download the asset:
  • True: download and unpack the file.
  • False: download the compressed file.
The default value is True.
An example with download()

Python

    asset.download(
    output_directory="/Users/max.mustermann/Desktop/",
    unpacking=False,
)

  

STAC assets

stac_info

The stac_info attribute returns the STAC collection associated with a specific UP42 asset. The returned data type is pystac.Collection.

An example with stac_info

Python

    asset.stac_info

  

stac_items

The stac_items attribute returns STAC items from a specific UP42 asset. The returned data type is pystac.ItemCollection.

An example with stac_items

Python

    asset.stac_items

  

download_stac_asset()

The download_stac_asset() function allows you to download a STAC asset from storage and returns the path to the downloaded file. A new directory for the file will be created. The returned data type is pathlib.Path.

ArgumentDescription
stac_assetpystac.Asset / required
The STAC asset to be downloaded.
output_directoryUnion[str, Path, None]
The file output directory. The default value is the current directory.
An example with download_stac_asset()

Python

    asset.download_stac_asset(
    stac_asset=asset.stac_items.items[0].assets.get("b01.tiff"),
    output_directory="/Users/max.mustermann/Desktop/",
)

  

get_stac_asset_url()

The get_stac_asset_url() function returns a signed download URL for a STAC asset. The generated URL can be used for up to 5 minutes to download the asset without authentication. The returned data type is str.

ArgumentDescription
stac_assetpystac.Asset / required
The STAC asset to be downloaded.
An example with get_stac_asset_url()

Python

    asset.get_stac_asset_url(
    stac_asset=asset.stac_items.items[0].assets.get("b01.tiff"),
)

  

A button link with the "View repository" text on it