请求有效负载大小超出限制:4194304字节

时间:2020-11-08 07:31:35

标签: javascript machine-learning random-forest google-earth-engine

我收到此错误,是因为我试图导出以驱动分类图像,该图像相当大,因为它包含了澳大利亚新南威尔士州的整个区域。手册说,在这种情况下,它将导出为许多较小的文件,但对我而言并非如此。请看一下我的代码,并帮助我弄清楚如何最终以1张或更多图片的形式导出它。 预先感谢。

//SPECIFY AND MODIFY THE AREA OF INTEREST 

var S2 = ee.ImageCollection('COPERNICUS/S2_SR')
                  .filterBounds(geometry);

var S2 = S2.filterMetadata('CLOUD_COVERAGE_ASSESSMENT', 'less_than', 5);

            
var S2 = S2.filterDate('2019-12-14','2020-01-16');

print(S2.size());

            
var S2_image = S2.first();

var S2_clipped_collection = S2.map(function (S2_image){
  return S2_image.clip(geometry);
});
print(S2_clipped_collection);


var S2_image = S2_image.select('B2');

var S2_clipped_collection = S2_clipped_collection
  .reduce(ee.Reducer.mean());

print(S2_clipped_collection);

var S2_clipped_collection = S2_clipped_collection.select( 'B2_mean', 'B3_mean', 'B4_mean', 'B5_mean', 'B6_mean', 'B7_mean', 'B8_mean', 'B11_mean','B12_mean');

Map.addLayer(S2_clipped_collection, {bands:['B4_mean', 'B3_mean', 'B2_mean'], min:500, max:2800}, "222");


var classnames = burned.merge(unburned);

var bands = ['B2_mean', 'B3_mean', 'B4_mean', 'B5_mean', 'B6_mean', 'B7_mean', 'B8_mean', 'B11_mean','B12_mean'];

var training = S2_clipped_collection.select(bands).sampleRegions({
  collection: classnames,
  properties: ['landcover'],
  scale: 10
});

print(training);

var classifier = ee.Classifier.smileRandomForest(100).train({
  features: training,
  classProperty: 'landcover',
  inputProperties: bands
});

//Run the classification
var classified = S2_clipped_collection.select(bands).classify(classifier);

//Display classification
Map.centerObject(classnames, 11);
Map.addLayer(classified,
{min: 0, max: 3, palette: ['red', 'blue', 'green','yellow']},
'classification');


Export.image.toDrive({
  image: classified, 
  description: 'description',
  region: geometry, 
  scale: 10, 
  crs: 'EPSG:25832',
  maxPixels: 1e19
});

1 个答案:

答案 0 :(得分:0)

这里的建议很简单,您的比例尺目前设置为10 m,这非常小。除非您绝对需要高分辨率,否则我建议至少将其提高到100 m。如果仍然无法导出,请减小几何尺寸或进一步增大比例。