javascript - 谷歌地球引擎: Region of Landsat Image

标签 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);

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

请帮助我构建这个区域。

最佳答案

我认为这就是您正在寻找的:

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

Image 1

  • 来自 GEE 的 LS 图像位于原始图像之上(GEE 图像具有红色像素) - 您可以清楚地看到原始图像中仍然存在 GEE 版本中缺失的 NoData 部分。我担心的是像素排列得不太好。
  • Image 2

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

    关于javascript - 谷歌地球引擎: Region of Landsat Image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43773240/

    相关文章:

    javascript - 为什么我会得到这个 NaN?

    javascript - 旋转背景图片

    mask - 哪个函数适用于云掩蔽

    google-earth-engine - 几何图形有太多边缘(Google Earth Engine)。帮我

    python - 如何从 Google Earth Engine python api 迭代和下载图像集合中的每个图像

    javascript - Angular 2 与[禁用]的双向绑定(bind)

    javascript - 在 React 中使用 Jquery 的正确方法是什么?

    google-cloud-datalab - NameError 使用 LinearRegression() 和 python API

    用于读取 LANDSAT XML 图元文件的 Python 脚本