【发布时间】:2020-06-03 22:32:12
【问题描述】:
正如函数documentation 所建议的那样,我们知道reduceRegion() 函数在由于服务器限制而出现“像素过多”错误时会派上用场。我目前正在使用 Google Colab,我的代码如下:
image = ee.Image('LANDSAT/LE7_TOA_5YEAR/2008_2012')
aoi = getPolygon((55.2708, 25.2048), 0.15)
# Reduce the region. The region parameter is the Feature geometry.
meanDictionary = image.reduceRegion(reducer=ee.Reducer.mean(), geometry=aoi, scale=90, maxPixels=262144)
我打印meanDictionary.getInfo()后自然得到的结果是一个不同波段值的字典:
{'B1': 48.80214808618162,
'B2': 50.636738705868815,
'B3': 53.1672805851419,
'B4': 58.36716764069926,
'B5': 56.440968073087255,
'B6_VCID_2': 209.51128253916946,
'B7': 43.215088529918695}
我的问题是,在使用其各自的参数调用 reduceRegion() 后,我如何将实际缩小的图像作为 ee.image.Image 对象,因为它只返回一个字典。我可能会偏离轨道,如果是这样,请提供一些正确方向的指导!
【问题讨论】:
标签: python-3.x gis google-colaboratory gdal google-earth-engine