Google地球引擎:Landsat图像的区域

时间:2017-05-04 03:11:35

标签: javascript google-earth-engine landsat

我在Google Earth Engine中有一些操作,例如:

// 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);

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

请帮我建一下这个地区。

1 个答案:

答案 0 :(得分:0)

我认为这就是你要找的东西:

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()来导出导出的比例(分辨率)。这确保我使用图像的原始分辨率(在这种情况下为30米)。您需要将getInfo添加到函数中以实际从服务器检索整数。 您也可以以米为单位指定30或任何其他所需的分辨率。

HTH

编辑:

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

3张图片:

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

    1. 来自原始图像顶部的GEE的LS图像(GEE图像具有红色像素) - 您可以清楚地看到GEE版本中仍然缺少原始图像的NoData部分。我要关注的是像素不能很好地排列。
    2. Image 2

      1. 两张图片的右上角:在这里您可以看到2张图片相隔多远
      2. enter image description here

相关问题