Google Earth Engine(GEE)——显示和下载影像出现的问题

简介: Google Earth Engine(GEE)——显示和下载影像出现的问题

当我们下载或者展示影像的时候会出现错误,本文主要解决两个问题,第一个就是解决影像展示的问题,展示如果不能正常显示影像的RGB影像,一般情况下主要出现的问题就在于最大值和最小值的设定,如果你不知道该如何设置,就直接去掉min和max的设置。这样也能正常显示,

Map.addLayer(eeObject, visParams, name, shown, opacity)

Adds a given EE object to the map as a layer.

Returns the new map layer.

Arguments:

eeObject (Collection|Feature|Image|RawMapId):

The object to add to the map.

visParams (FeatureVisualizationParameters|ImageVisualizationParameters, optional):

The visualization parameters. For Images and ImageCollection, see ee.data.getMapId for valid parameters. For Features and FeatureCollections, the only supported key is "color", as a CSS 3.0 color string or a hex string in "RRGGBB" format. Ignored when eeObject is a map ID.

name (String, optional):

The name of the layer. Defaults to "Layer N".

shown (Boolean, optional):

A flag indicating whether the layer should be on by default.

opacity (Number, optional):

The layer's opacity represented as a number between 0 and 1. Defaults to 1.

Returns: ui.Map.Layer

原始代码:

var roi = 
    /* color: #d63000 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[30.335363045782245, -22.81645461186883],
          [30.335363045782245, -23.114862567618875],
          [30.74597705945412, -23.114862567618875],
          [30.74597705945412, -22.81645461186883]]], null, false);
// Exporting Lansat 8 images
// Load Landsat 8 
var image= ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
.filterDate("2017-01-01", "2017-12-31")
.filterBounds(roi)
.sort("CLOUD_COVER")
.first();
var vispaaramsTrue = {bands: ["SR_B4", "SR_B3", "SR_B2"], min: 0, max: 3000, gamma:1.4};
Map.addLayer(image.clip(roi), vispaaramsTrue, "Landsat 2017");
Map.centerObject(roi, 10);
// Export to drive
Export.image.toDrive({
image: image,
description: "Landsat2017Thohoyandou",
scale: 30,
region: roi,
maxPixels: 1e13
});

 

修改后的代码:

// Exporting Lansat 8 images
// Load Landsat 8 
var image= ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
.filterDate("2017-01-01", "2017-12-31")
.filterBounds(roi)
.sort("CLOUD_COVER")
.first();
print(image)
var vispaaramsTrue = {bands: ["SR_B4", "SR_B3", "SR_B2"], min: 5000, max: 15000};
Map.addLayer(image.clip(roi), vispaaramsTrue, "Landsat 2017");
Map.centerObject(roi, 10);
// Export to drive
Export.image.toDrive({
image: image,
description: "Landsat2017Thohoyandou",
scale: 30,
region: roi,
maxPixels: 1e13
});

 

这里值得注意的是我们在下载影像的时候,我们必须得完成影像的的mosaic而不是使用.first()因为你下载first,你只能下载第一景影像而不是所有指定时间范围内的影像数据的聚合类型。否则下来的就直接是黑色的,大家可以去尝试一下

 

相关文章
|
3月前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
553 0
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
3月前
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
106 0
|
2月前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
260 0
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
3月前
|
API Go 网络架构
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
90 4
|
3月前
|
机器学习/深度学习 存储 人工智能
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
72 3
|
3月前
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
27 0
|
3月前
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
45 0
|
3月前
|
编解码
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
21 0
|
3月前
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
45 0
|
3月前
|
传感器 编解码 数据处理
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
23 0

热门文章

最新文章