【问题标题】:How do I merge a collection of imagines into a single image then export it如何将一组图像合并为单个图像,然后将其导出
【发布时间】:2023-02-16 18:51:47
【问题描述】:

我想将多边形的一组图像(数量未知)合并为一个图像,然后将其导出到谷歌驱动器以在 qgis 中进行分析。这是我试过的代码

// Define the AOI
var aoi = XXX;
Map.centerObject(aoi);
Map.setOptions('SATELLITE');

var dataset = ee.ImageCollection('UQ/murray/Intertidal/v1_1/global_intertidal');

var visualization = {
  bands: ['classification'],
  min: 0.0,
  max: 1.0,
  palette: ['0000FF']
};


Map.addLayer(dataset, visualization, 'Intertidal areas');

我试过下面的代码来导出图像,但显然因为我正在查看一组图像,所以无法导出马赛克的单个图像

// Export to base Google Drive 
Export.image.toDrive({ image: FraserRiver , description: 'exportToDrive', fileNamePrefix: ' FraserRiver', scale: 30, region: aoi, maxPixels: 800000000000 });

【问题讨论】:

  • 听起来您正在制作马赛克。当您可视化图像集合时,这种情况会隐式发生 - 在图像重叠的地方,它会自动将最新图像放在最上面。您需要明确地执行此操作并将输出分配给一个您可以随后导出的变量。尝试 developers.google.com/earth-engine/guides/ic_composite_mosaic 作为初学者。请注意,您可以通过多种方式制作马赛克 - 最近的像素、最绿的像素、无云像素等。创建单个图像后,您就可以将其导出。

标签: google-earth-engine


【解决方案1】:

此代码简单地提取图像集合中的所有波段并将它们放在一个图像中:

var image = ee.Image(mycollection.iterate(mergeBands, ee.Image([])))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-15
    • 1970-01-01
    • 2016-05-04
    • 1970-01-01
    • 1970-01-01
    • 2020-05-29
    • 2021-04-27
    • 2020-09-17
    相关资源
    最近更新 更多