如何从 Google Earth Engine 获取图像集的下载网址

kri*_*nab 5 python image google-earth-engine

我对 Google Earth Engine 还比较陌生,但有一个关于获取图像集合中每个图像的下载 URL 的问题。问题正是如此,鉴于我已将每个图像削减到合理的大小,如何获取图像集合中每个图像的下载 url 集。

请注意,我确实浏览了 Stackoverflow,发现了一个有关将单个图像下载到 google Drive 的现有问题,但该问题没有提供有关图像集合的任何信息。

如何使用Google Earth引擎的Python API下载图像

以下代码将生成 Landsat 8 图像的一些小图像块。每个补丁的大小只有少数 kb。

import ee
ee.Initialize()
col = ee.ImageCollection('LANDSAT/LC08/C01/T1').select('B8')
col.filterDate('1/1/2015', '1/30/2015')
boundary_region = ee.Geometry.Point([-2.40986111110000012, 26.76033333330000019]).buffer(300)
col.filterBounds(boundary_region)

def clipper(image):
    return image.clip(region)

col.map(clipper)
Run Code Online (Sandbox Code Playgroud)

现在我想下载集合中的每张图像col

Earth Engine 提供了几种迭代图像集合的方法:map()iterate()函数,但显然这两个函数都不适用于下载函数。

现在看来我可以使用以下函数生成单个图像的 url:

boundary_geojson = ee.Geometry.Polygon(boundary_region.bounds().getInfo().coordinates[0]).toGeoJSONString()

def downloader(image): 
    url = ee.data.makeDownloadUrl(
        ee.data.getDownloadId({
            'image': image.serialize(),
            'scale': 30,
            'filePerBand': 'false',
            'name': 'test',
            'region': boundary_geojson,
        }))
    return url
Run Code Online (Sandbox Code Playgroud)

请注意,由于某种原因,我似乎无法让变量boundary_geojson正常工作。

现在这组 url 应该是一个简单的调用

col.map(downloader)
Run Code Online (Sandbox Code Playgroud)

但这不起作用。

有谁知道如何生成与图像集合中的图像相对应的网址列表?