【问题标题】:Exporting images from image collection in Google Earth Engine - user memory limit exceeded从 Google 地球引擎中的图像集合中导出图像 - 超出用户内存限制
【发布时间】:2021-06-04 04:36:48
【问题描述】:

我是 GEE 的新手,我正在尝试处理一些图像,然后下载结果。我需要掩盖大约 30 年的 Landsat 数据,以隔离不同的土地覆盖类型、去除云层并计算植被指数。然后,我需要导出这些数据以在 R 中进行进一步分析。我已经设法完成了所有的掩蔽和计算植被指数,但是当我去导出数据时,它给了我user memory limit exceeded 错误。我尝试一次只下载 1 年的数据,但遇到了同样的错误。我不确定如何完成我正在做的事情,即在 GEE 中对数据进行大量处理,然后将其导出以在其他地方进行额外的分析。有什么建议吗?代码如下。

编辑:按照建议添加 ROI 信息。

var l8sr = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
  .filterDate('2013-07-01','2018-06-30');
  
//Function to mask forest
var maskForest = function(img){
  var mask = forest.eq(1);
  return img.updateMask(mask);
};

// Function to mask flooded area
var maskFld = function(img){
  var mask = fldpln.eq(1);
  return img.updateMask(mask);
};

// Cloud masking function
var mask = require('users/fitoprincipe/geetools:cloud_masks');

var mask_fun = mask.landsatSR();

// Create EVI mapping functions
var EVI8 = function(img){
  var evi = img.expression(
  '2.5*((NIR/10000-RED/10000)/(NIR/10000 + 6 * RED/10000 - 7.5 * BLUE/10000 + 1))', {
    'NIR': img.select('B5'),
    'RED': img.select('B4'),
    'BLUE': img.select('B2')
  }).rename('EVI');
return(img.addBands(evi));
};

// Map the forest/savanna/cloud masks and indices to the image collections and select the VI bands
var l8srFldFor = l8sr.map(maskForest).map(maskFld).map(mask_fun).map(EVI8)

// Download images from collection to Drive
var batch = require('users/fitoprincipe/geetools:batch');

var roi = ee.Geometry.Rectangle([[-48.425,-9.577],[-48.036,-8.390]]);

batch.Download.ImageCollection.toDrive(l8srFldFor, 'LandsatTiles', 
                {scale: 30, 
                region: roi,
                 type: 'float'});```

【问题讨论】:

  • 您总共要下载多少张图片?
  • 最终,大约有 380 张图像。我确实尝试将其减少到仅 1 个月的价值,也就是 2 张图片,但我得到了同样的错误。
  • 你是如何定义你感兴趣的区域的?
  • @JonathanV.Solórzano 我添加了这两行:roi = ee.Geometry.Rectangle([[xxxxxxx,xxxxxx],[xxxxxxx,xxxxxxx]])region: roi.getInfo()["coordinates"], xxxxx 是感兴趣区域的坐标信息。第二行在batch.Download.ImageCollection.toDrive的大括号中
  • 您可以尝试将batch.Download.ImageCollection.toDriveregion 参数设置为roi

标签: javascript export google-earth-engine landsat


【解决方案1】:

我认为问题在于您没有对 landsat 8 集合应用任何空间过滤器。因此,生成的集合包括从“2013-07-01”到“2018-06-30”获取的每个 landsat 8 图像。所以这可能是导致user memory limit exceeded 错误的原因。要根据您的 roi 应用空间过滤器,您应该使用 filterBounds

var roi = ee.Geometry.Rectangle([[-48.425,-9.577],[-48.036,-8.390]]);
var l8sr = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
  .filterDate('2018-05-01','2018-06-30')
  .filterBounds(roi);

【讨论】:

  • 这就是问题所在。感谢您的修复!
【解决方案2】:

你想从世界各地下载吗?

【讨论】:

  • 天使:请在此处使用评论
  • 没有。我还在下载中添加了 ROI,但我得到了同样的错误。我要下载的区域相对较小(小于单个 Landsat 磁贴)。
猜你喜欢
  • 2017-10-07
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 2023-03-22
  • 1970-01-01
  • 1970-01-01
  • 2018-02-22
  • 2019-05-21
相关资源
最近更新 更多