首页 > 解决方案 > “创建或提交任务时出错请求有效负载大小超出限制:4194304 字节”

问题描述

对于以下代码,我遇到“错误创建或提交任务请求有效负载大小超出限制:4194304 字节”。

请注意,更改比例对我来说不是一个选项,我需要 30 m 比例。

如果我手动绘制几何图形,此错误就会消失。但这并不完美。而且我有很多领域。

此外,当我使用手动绘制的几何图形时,我的栅格的 NDVI 值为 -3.40282e+38 到 3.40282e+38。

var table = ee.FeatureCollection("users/tafzilamouly/QLD"),
        L5 = ee.ImageCollection("LANDSAT/LT05/C01/T1_SR"),
        hansen = ee.Image("UMD/hansen/global_forest_change_2018_v1_6");

    //Filter region and time period

    var L52009annual= L5.filterDate('2009-01-01',"2009-12-31")

    var AUS= ee.FeatureCollection(table)
    var QLD= AUS.geometry()

    var Australia2009annual= ee.ImageCollection(L52009annual).filterBounds(QLD)

    //Map.addLayer(Australia2009annual, {}, 'Australia2009annual')


    //NDVI

    var addNDVI= function addNDVI(image){
      var ndvi= image.normalizedDifference(['B4', 'B3']).rename('NDVI');
      return image.addBands(ndvi);
    };

    // Cloud mask
    var cloudMaskL457 = function(image) {
      var qa = image.select('pixel_qa');
      // If the cloud bit (5) is set and the cloud confidence (7) is high
      // or the cloud shadow bit is set (3), then it's a bad pixel.
      var cloud = qa.bitwiseAnd(1 << 5)
              .and(qa.bitwiseAnd(1 << 7))
              .or(qa.bitwiseAnd(1 << 3))
      // Remove edge pixels that don't occur in all bands
      var mask2 = image.mask().reduce(ee.Reducer.min());
      return image.updateMask(cloud.not()).updateMask(mask2);
    };

    // land mask

    var landMask = function(image) {
    var datamask = hansen.select('datamask');
    var mask = datamask.eq(1);
    return image.updateMask(mask);
    };

    var NDVI2009annual= ee.ImageCollection(Australia2009annual)
        .map(addNDVI)
        .map(cloudMaskL457)
        .map(landMask)
        .mean()

    //print(NDVI2009annual)
    //select band NDVI
    var NDVI= NDVI2009annual.select('NDVI')
    //select NDVI value 0-1
    var positiveNDVI2009annual= NDVI.mask(NDVI)
    print(positiveNDVI2009annual)
    Map.addLayer(positiveNDVI2009annual, {}, 'positiveNDVI2009annual')

    Export.image.toDrive({
      image: positiveNDVI2009annual,
      description: 'NDVI_2009_annual',
      region: QLD,
      scale: 30,
      fileFormat: 'GeoTIFF',
      maxPixels: 33491829976,
      });

标签: exportgoogle-earth-engine

解决方案


Request payload size exceeds the limit: 4194304 bytes.当我尝试在导出“区域:my_geometry”期间使用多几何图形时,我收到了相同的错误消息。这也造成了进程缓慢,不切实际,甚至造成页面无响应。我怀疑几何中的复杂性。

我的解决方案是,

  • 我遮盖了我的图像(通过使用几何进行裁剪并将遮罩更新为我的图像)。
  • 我没有在导出函数中使用“region: my_geometry”,而是省略了它并将地图放大到整个区域。然后我可以成功导出它。

推荐阅读