0

I'm using GEE for NDVI (using landsat 8) but there is many holes in my image, can someone explain me what happened? here's the code

// Function to mask clouds using the quality band of Landsat 8.
var maskL8 = function(image) {
  var qa = image.select('pixel_qa');
  /// Check that the cloud bit is off.
  // See https://landsat.usgs.gov/collectionqualityband
  var mask = qa.bitwiseAnd(1 << 5).eq(0);
  return image.updateMask(mask);
};

var filter = l8.filterDate('2021-01-01','2023-12-31').map(maskL8).median().clip(table);


var ndvi = filter.normalizedDifference(['B5','B4']);
var lst = filter.select(['B10']).subtract(273);

Map.addLayer(lst)
Map.addLayer(ndvi)
Export.image.toDrive({
  image: ndvi,
  scale: 100,
  description: 'MAXENT-NDVI',
  region: table,
  maxPixels: 1e12
});

enter image description here

3
  • The "holes" should correspond to masked areas. I recommend checking the pixel_qa bits definition directly in the GEE collection information to mask exactly what you want, for example: developers.google.com/earth-engine/datasets/catalog/…. Commented Jan 16 at 16:00
  • I'm sorry I still don't understand, so the code I should change are in this line var mask = qa.bitwiseAnd(1 << 5).eq(0) ?
    – MapperIndo
    Commented Jan 17 at 0:51
  • The code you shared is not reproducible. Looking at the QA band name (pixel_qa) I assume you are running an old code relying on Landsat Collection 1 Commented Jan 17 at 19:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.