【问题标题】:How save a sattelite image in earth engine?如何在地球引擎中保存卫星图像?
【发布时间】:2018-07-01 08:31:00
【问题描述】:

我正在搜索如何将图像从地球引擎导出到驱动器。 但我希望我的形象是卫星形象。 我该怎么做 ?可能吗? 提前谢谢你。

我已经阅读了地球引擎的文档。我找到了这个程序:

var landsat = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_123032_20140515') .select(['B4', 'B3', 'B2']);

 // Create a geometry representing an export region. 
var geometry = ee.Geometry.Rectangle([116.2621, 39.9, 116.3849, 40.0]);

 // Export the image, specifying scale and region.
 Export.image.toDrive({ image: landsat, description: 'test', scale: 30, region: geometry, format:"png" });

但它给了我一个损坏的文件

【问题讨论】:

标签: javascript google-earth-engine save-image


【解决方案1】:

我发现您提供的代码唯一有问题的是format 不是您可以传递给Export.image.toDrive() 函数的参数之一。

当我删除您的代码中的 format: "png" 部分时,我在我的 Google 云端硬盘中得到了一个名为 test.tif 的文件,这是我所期望的。在 Google Earth Engine Javascript 编辑器中,可以导出图像的唯一格式是 geotiff (.tif) 文件。

var landsat = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_123032_20140515').select(['B4', 'B3', 'B2']);

// Create a geometry representing an export region. 
var geometry = ee.Geometry.Rectangle([116.2621, 39.9, 116.3849, 40.0]);

// Export the image, specifying scale and region. 

Export.image.toDrive({ image: landsat, description: 'test', scale: 30, region: geometry});

这是link to that script

请记住,您从此代码中获得的 3 波段图像在某些应用程序中可能无法很好地呈现,即使所有数据仍然存在。看起来文件已损坏,但代码确实生成了可用的 geotiff 文件。

为了说明这一点,当我在 Mac 上的 Preview 中打开文件时,它看起来像这样:

但如果我在 QGIS 中打开它,它看起来像这样:

【讨论】:

  • 如果打算将其保存为 png 怎么办,有可能吗?怎么样?
【解决方案2】:

除了mikoontz 的回答之外,您不能只使用普通图像查看器查看 GeoTIFF 图像,而是尝试使用任何 GeoTIFF 图像查看软件。

观众名单:https://www.gislounge.com/free-gis-data-viewers/

注意:他们中的大多数不仅仅是查看器,他们能够做的不仅仅是查看 GeoTIFF 图像。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多