Summary
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.
Syntax
GetSTACInfo (stac_url, {verbose})
Parameter | Explanation | Data Type |
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. (The default value is False) | Boolean |
Data Type | Explanation |
Dictionary | The parsed information from the STAC URL as a dictionary. |
Code sample
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)