GetSTACInfo
Résumé
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})
| Le paramètre | Explication | Type de données |
|---|---|---|
|
stac_url |
The URL of the STAC resource. |
String |
|
verbose |
Specifies the level of information returned. If set to The default value is False. |
Boolean |
Valeur de retour
| Type de données | Explication |
|---|---|
|
Dictionary |
The parsed information from the STAC URL as a dictionary. |
Exemple de code
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)
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)
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)
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)