Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 谷歌地球引擎:陆地卫星图像区域_Javascript_Google Earth Engine_Landsat - Fatal编程技术网

Javascript 谷歌地球引擎:陆地卫星图像区域

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

我在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}, '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张图片:

  • 原始LS图像的左上角(从EarthXPlorer下载)-红色 指示
    NoData
  • 原始图像上方的LS图像(GEE图像具有redish像素)-您可以清楚地看到原始图像的
    NoData
    部分在GEE版本中丢失。我担心的是像素排列不整齐
  • 两幅图像的右上角:在这里,您可以看到两幅图像之间的距离

  • 谢谢您的建议。我试着按照你的建议提取B3,结果图像非常接近原始图像,但仍然有不同的维度(7647x7803而不是7671x7811)!我不会担心这个小小的差别。
    .geometry()
    函数提供图像的真实足迹,这是google earth引擎的全部功能。与元数据中所述内容的差异是由于原始数据集中的
    NoData
    边缘较小。因此,当您从GEE下载图像时,您的尺寸可能稍小,但“真实”图像的尺寸相同。再次感谢您的解释!我认为,我应该接受这个真正的GEE。如果你对我的解释感到满意,请考虑接受我的答案。非常感谢。