0

enter image description here

I'm trying to display landsat 8 with Google Earth Engine that are clipped with my shapefile but there's an error. Is there something wrong with my script?

    // 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('2020-01-01','2023-12-31').map(maskL8).median().clip(table);

var scene = l8.filterDate
var visParams = {bands: ['B5', 'B6', 'B7'], max: 0.3};
Map.addLayer(scene, visParams, '567 composite');
2
  • 1
    From your code snippet, there is no such lines as b.call.
    – Padmanabha
    Commented Jan 15 at 2:55
  • yes i also confused i don't type b.call but there's an error about it
    – MapperIndo
    Commented Jan 15 at 3:18

2 Answers 2

0

This line is invalid:

var scene = l8.filterDate

You're ultimately trying to display a function; that's not going to work.

1
  • then what should i do to fix it?
    – MapperIndo
    Commented Jan 16 at 1:01
0

An answer for errors in the sample code is this:

  • remove var scene = l8.filterDate
  • change Map.addLayer(scene, ... to Map.addLayer(filter, ...

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.