[英]Exporting images from image collection in Google Earth Engine - user memory limit exceeded
I'm fairly new to GEE, and I'm trying to process some imagery, then download the results.我对 GEE 还很陌生,我正在尝试处理一些图像,然后下载结果。 I need to mask about 30 years of Landsat data to isolate different land cover types, remove clouds, and calculate vegetation indices.
我需要掩盖大约 30 年的 Landsat 数据,以隔离不同的土地覆盖类型、去除云层并计算植被指数。 Then, I need to export these data to do further analyses in R.
然后,我需要将这些数据导出到 R 中做进一步的分析。 I've managed to do all of the masking and calculating vegetation indices, but when I go to export the data, it gives me the
user memory limit exceeded
error.我已经设法完成了所有的掩蔽和计算植被指数,但是当我 go 导出数据时,它给了我
user memory limit exceeded
错误。 I tried to only download 1 year of data at a time but got the same error.我尝试一次只下载 1 年的数据,但遇到了同样的错误。 I'm not sure how to accomplish what I'm doing, which is to do the heavy processing of the data in GEE then export it to do the additional analyses elsewhere.
我不确定如何完成我正在做的事情,即在 GEE 中对数据进行大量处理,然后将其导出以在其他地方进行额外的分析。 Any recommendations?
有什么建议吗? Code below.
代码如下。
Edit: Added the ROI information as recommended.编辑:按照建议添加了 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'});```
Are you trying to download from all over the world?你想从世界各地下载吗?
I think the problem is that you are not applying any spatial filter to the landsat 8 collection.我认为问题在于您没有对 landsat 8 集合应用任何空间过滤器。 Therefore, the resulting collection is including every landsat 8 image acquired from '2013-07-01' to '2018-06-30'.
因此,生成的集合包括从“2013-07-01”到“2018-06-30”获取的每幅 landsat 8 图像。 So probably that was causing the
user memory limit exceeded
error.所以这可能是导致
user memory limit exceeded
错误。 To apply a spatial filter based on your roi
you should use filterBounds
.要根据您的
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);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.