GetSTACInfo
汇总
从 时空资产目录 (STAC) URL 检索信息。
此函数可检索并解析从给定 STAC URL 检索的信息。 它支持 STAC Catalog 、 Collection 、 Item 和 ItemCollection 对象。
讨论
此函数可汇总 STAC 信息,这些信息用于更好的理解在使用 Raster 对象的 fromSTACItem 方法以及 RasterCollection 对象的 fromSTACAPI 和 fromSTACCatalog 方法时,传递或查询哪些内容。
语法
GetSTACInfo(stac_url, {verbose})
| 参数 | 说明 | 数据类型 |
|---|---|---|
|
stac_url |
The URL of the STAC resource. |
String |
|
verbose |
Specifies the level of information returned. If set to (默认值为 False) |
Boolean |
返回值
| 数据类型 | 说明 |
|---|---|
|
Dictionary |
从 STAC URL 解析的信息作为字典。 |
代码示例
GetSTACInfo 示例 1
从 STAC API(STAC API)检索详细信息。
import arcpy
stac_info = arcpy.GetSTACInfo(
"https://planetarycomputer.microsoft.com/api/stac/v1", verbose=True
)
print(stac_info)
GetSTACInfo 示例 2
从 STAC 集合检索基本信息(Planetary Computer 上的 Landsat C2-L2 集合)。
import arcpy
stac_info = arcpy.GetSTACInfo(
"https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2",
verbose=False
)
print(stac_info)
GetSTACInfo 示例 3
从 STAC 项目检索基本信息(Planetary Computer 上的 NAIP 数据)。
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 示例 4
从 ItemCollection 检索详细信息(Earth Search 上的 NAIP 数据)。
import arcpy
stac_info = arcpy.GetSTACInfo(
"https://earth-search.aws.element84.com/v1/collections/naip/items", verbose=True
)
print(stac_info)