0

I am trying to perform a raster calculation (EVI) on an imagery collection. This operation is seen on Line 130 and is based on:

https://developers.google.com/earth-engine/image_math (which I know is for single images). In addition to being an imageCollection, my version of this GEE provided code differs in that I've renamed my bands prior to calculating EVI.

I am having trouble finding the necessary format to apply a band math equation to an imagery collection.

Presently, I am receiving an error: "Cloudfiltered.expression is not a function"

Here is my script: https://code.earthengine.google.com/0e9ae4a031ddd2d46fe44d40cc03b05e

The Region of Interest: "ROI" was made with the Rectangle Tool in GEE and can be totally arbitrary; I don't know how to share it. Here is mine for context: https://imgur.com/a/86H9iJ1

3

The way to add EVI to every image in an image collection in Earth Engine is to map() a function over the collection.

// First, create function
var addEVI = function(image) {
  var evi = ee.Image(0).expression(
    '2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {
      'NIR': image.select('NIR'),
      'RED': image.select('RED'),
      'BLUE': image.select('BLUE')
    });
  return image.addBands(evi.rename('evi'));
};

// Second, apply function over your collection
var mergedEVI = Cloudfiltered.map(addEVI);

The variable mergedEVI is an image collection in which every image has a band named "evi".

More information https://developers.google.com/earth-engine/ic_mapping

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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