【问题标题】:Google Earth Engine: Region of Landsat ImageGoogle 地球引擎:Landsat 图像区域
【发布时间】:2017-05-04 03:11:35
【问题描述】:

我在 Google 地球引擎中进行了一些操作,例如:

// Load a cloudy Landsat scene and display it.
var cloudy_scene = ee.Image('LANDSAT/LC8_L1T_TOA/LC80440342014269LGN00');
Map.centerObject(cloudy_scene);
Map.addLayer(cloudy_scene, {bands: ['B4', 'B3', 'B2'], max: 0.4}, 'TOA', false);

// Add a cloud score band.  It is automatically called 'cloud'.
var scored = ee.Algorithms.Landsat.simpleCloudScore(cloudy_scene);

// Create a mask from the cloud score and combine it with the image mask.
var mask = scored.select(['cloud']).lte(20);

// Apply the mask to the image.
var masked = cloudy_scene.updateMask(mask);

现在我想使用方法Export.image.toDrive将结果(masked)导出到谷歌驱动器,但我不知道如何指定参数region以满足与原始图像LANDSAT/LC8_L1T_TOA/LC80440342014269LGN00相同的要求。

请帮我构建这个区域。

【问题讨论】:

    标签: javascript google-earth-engine landsat


    【解决方案1】:

    我想这就是你要找的东西:

    Export.image.toDrive({
    
      image:masked.select('B3'),
      description: 'Masked_Landsat_Image',
      region:masked.geometry(),
      scale:mask.projection().nominalScale().getInfo()
    
    })
    

    在这种情况下,我使用图像的足迹(image.geometry())来定义我的导出区域。

    请注意,我使用函数 mask.projection().nominalScale().getInfo() 来导出导出的比例(分辨率)。这确保我使用的是图像的原始分辨率(在本例中为 30m)。您需要将getInfo 添加到函数中才能实际从服务器检索整数。 您也可以只指定 30 或任何其他所需的分辨率(以米为单位)。

    HTH


    编辑:

    只是对我在下面评论中所写内容的视觉帮助:

    3 张图片:

    1. 原始 LS 图像的左上角(从 EarthExplorer 下载)- 红色 表示NoData

    1. 来自 GEE 的 LS 图像在原始图像之上(GEE 图像有红色像素) - 您可以清楚地看到原始图像的 NoData 部分在 GEE 版本中丢失。我担心的是像素排列不整齐。

    1. 两张图片的右上角:在这里您可以看到两张图片相距多远

    【讨论】:

    • 感谢您的建议。我尝试按照您的建议提取 B3,结果图像非常接近原始图像,但它仍然具有不同的尺寸(7647x7803 而不是 7671x7811)。 !
    • 我不会担心这个小差异。 .geometry() 函数为您提供图像的真实足迹,这是谷歌地球引擎的全部。与元数据中所述的差异是由于原始数据集中NoData 的小边缘。因此,当您从 GEE 下载图像时,您的尺寸可能会稍小,但“真实”图像的尺寸相同。
    • 再次感谢您的解释!我想,我应该接受这个真实的 GEE。
    • 如果您对我的解释感到满意,请考虑接受我的回答。谢谢。
    猜你喜欢
    • 2023-03-22
    • 1970-01-01
    • 2017-10-07
    • 1970-01-01
    • 2017-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多