Javascript 谷歌地球引擎:陆地卫星图像区域
我在Google Earth引擎中进行了一些操作,例如:Javascript 谷歌地球引擎:陆地卫星图像区域,javascript,google-earth-engine,landsat,Javascript,Google Earth Engine,Landsat,我在Google Earth引擎中进行了一些操作,例如: // 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}, 'T
// 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
,以满足原始图像陆地卫星/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或任何其他所需的分辨率(以米为单位)
嗯
编辑: 这只是我在下面评论中所写内容的视觉辅助: 3张图片:
NoData
NoData
部分在GEE版本中丢失。我担心的是像素排列不整齐谢谢您的建议。我试着按照你的建议提取B3,结果图像非常接近原始图像,但仍然有不同的维度(7647x7803而不是7671x7811)!我不会担心这个小小的差别。
.geometry()
函数提供图像的真实足迹,这是google earth引擎的全部功能。与元数据中所述内容的差异是由于原始数据集中的NoData
边缘较小。因此,当您从GEE下载图像时,您的尺寸可能稍小,但“真实”图像的尺寸相同。再次感谢您的解释!我认为,我应该接受这个真正的GEE。如果你对我的解释感到满意,请考虑接受我的答案。非常感谢。