Google Earth Engine:陆地卫星图像区域
Google Earth Engine: Region of Landsat Image
我在 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 驱动器,但我不知道如何将参数 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 张图片:
- 原始 LS 图像的左上角(从 EarthExplorer 下载)- 红色
表示
NoData
- 来自 GEE 的 LS 图像位于原始图像之上(GEE 图像具有红色像素)- 您可以清楚地看到 GEE 版本中仍然缺少原始图像的
NoData
部分。我会担心的是像素排列不整齐。
- 两张图片的右上角:在这里你可以看到两张图片相距多远
我在 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 驱动器,但我不知道如何将参数 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 张图片:
- 原始 LS 图像的左上角(从 EarthExplorer 下载)- 红色
表示
NoData
- 来自 GEE 的 LS 图像位于原始图像之上(GEE 图像具有红色像素)- 您可以清楚地看到 GEE 版本中仍然缺少原始图像的
NoData
部分。我会担心的是像素排列不整齐。
- 两张图片的右上角:在这里你可以看到两张图片相距多远