1

The following is the code I used, please help me out to solve this error so that I can be able to produce the time series plot. thanks in advance! when I run this code I get this error "Error generating chart: User memory limit exceeded."

    var img = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR"). filterBounds(tibet)
    .filterDate('2019-01-01','2019-07-31')

    Map.centerObject(tibet,5);
    Map.addLayer(img,{bands:['B4','B3','B2'],min:0, max:3000, gamma:1.4}, 'raw');

    var maskClouds = function(image) {
      var pixel_qa = image.select('pixel_qa');
      return image.updateMask(pixel_qa.eq(322))
    };
    print(maskClouds,'mask');

    var img_masked = img.map(maskClouds);

    Map.addLayer(img_masked,{bands:['B4','B3','B2'],min:0, max:3000, gamma:1.4}, 'no_cloud');

    var getNDVI = function(img) {
    return img.addBands(img.normalizedDifference(['B5','B4']).rename('NDVI'));
    };

   var img_ndvi = img_masked.map(getNDVI);

   // print(img_ndvi,'img_ndvi0');

   var composite = img_ndvi.qualityMosaic('NDVI').clip(tibet);

  // Visualize NDVI
  var ndviPalette = ['FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718',
              '74A901', '66A000', '529400', '3E8601', '207401', '056201',
              '004C00', '023B01', '012E01', '011D01', '011301']
  Map.addLayer(composite.select('NDVI'),{min:0, max: 1, palette: ndviPalette}, 'ndvi');

//  visualize
var chart = ui.Chart.image.seriesByRegion(img_ndvi, tibet, ee.Reducer.mean(), 'NDVI', 
250,'system:time_start', 'label');
print(chart);
Teehaysh
  • 11
  • 2

1 Answers1

0

Decrease the resolution by choose a larger number for the Scale parameter in seriesByRegion.

https://developers.google.com/earth-engine/debugging

Djaner Emin
  • 35
  • 1
  • 6