问题描述
我需要从 ee 的集合中下载单个或多个图像。 (最好是多个,但我只能将单个图像代码放入循环中)。
我的主要问题 --> 使用缩放 9 下载从开始日期到结束日期的每个月图像(纬度:“”,长:“”)
我正在尝试从 SKYSAT/GEN-A/PUBLIC/ORTHO/RGB
下载历史简单卫星数据。这给出了一个像 -->
我正在 python
处理此问题。所以这段代码会给我集合,但我不能下载整个集合,我需要从中选择一个图像。
import ee
# Load a Landsat 8 ImageCollection for a single path-row.
collection = (ee.ImageCollection('SKYSAT/GEN-A/PUBLIC/ORTHO/RGB').filterDate('2016-03-01','2018-03-01'))
#pp.pprint('Collection: '+str(collection.getInfo())+'\n')
# Get the number of images.
count = collection.size()
print('Count: ',str(count.getInfo()))
image = ee.Image(collection.sort('CLOUD_COVER').first())
此处的 image
包含 <ee.image.Image at 0x23d6cf5dc70>
属性,但我不知道如何下载。
另外,我如何指定我想要的特定位置(纬度、经度)和缩放 19。
谢谢你的一切
解决方法
通过构建边界框插入您的分析区域 (geom)。然后,使用下面的代码批量下载图片。
// Example geometry. You could also insert points etc.
var geom = ee.Geometry.Polygon(
[[[-116.8,44.7],[-116.8,42.6],[-110.6,44.7]]],None,False)
for (var i = 0; i < count ; i++) {
var img = ee.Image(collection.toList(1,i).get(0));
var geom = img.geometry().getInfo();
Export.image(img,img.get('system:index').getInfo(),{crs: crs,scale: scale,region: geom});
}