GetSTACInfo

Synthèse

Retrieves information from a SpatioTemporal Asset Catalog (STAC) URL.

This function retrieves and parses information from a given STAC URL. It supports the STAC Catalog, Collection, Item, and ItemCollection objects.

Discussion

This function gathers STAC information, which can be used to better understand what to pass or query when using the Raster object's fromSTACItem method, and the RasterCollection object's fromSTACAPI and fromSTACCatalog methods.

Syntaxe

GetSTACInfo (stac_url, {verbose})
ParamètreExplicationType de données
stac_url

The URL of the STAC resource.

String
verbose

Specifies the level of information returned. If set to True, detailed information is returned. If set to False, only essential information is returned.

(La valeur par défaut est False)

Boolean
Valeur renvoyée
Type de donnéesExplication
Dictionary

The parsed information from the STAC URL as a dictionary.

Exemple de code

GetSTACInfo example 1

Retrieve detailed information from a STAC API (Planetary Computer).

import arcpy
stac_info = arcpy.GetSTACInfo(
    "https://planetarycomputer.microsoft.com/api/stac/v1", verbose=True
)
print(stac_info)
GetSTACInfo example 2

Retrieve essential information from a STAC Collection (Landsat C2-L2 collection on Planetary Computer).

import arcpy
stac_info = arcpy.GetSTACInfo(
    "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2",
    verbose=False
)
print(stac_info)
GetSTACInfo example 3

Retrieve essential information from a STAC Item (NAIP data on Planetary Computer).

import arcpy
    stac_info = arcpy.GetSTACInfo(
    "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/wa_m_4712125_sw_10_060_20191029_20191217"
)
print(stac_info)
GetSTACInfo example 4

Retrieve detailed information from an ItemCollection (NAIP data on Earth Search).

import arcpy
stac_info = arcpy.GetSTACInfo(
    "https://earth-search.aws.element84.com/v1/collections/naip/items", verbose=True
)
print(stac_info)