“错误创建或提交任务请求有效负载大小超出限制:4194304字节”

时间:2020-05-30 17:27:32

标签: export google-earth-engine

对于以下代码,我遇到了“创建或提交任务请求有效负载大小超出限制的错误: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,
      });

1 个答案:

答案 0 :(得分:0)

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

我的解决方法是

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