Add properties and filter

Evaluate a statement, add the results as a property to the image and use this property to filter.

Use the script below or follow this link.


// filter the date
var NDVI = gimms.filterDate(‘1981-01-01’, ‘1990-12-31’).sort(‘system:time_start’, false).select(“ndvi”);

// funtion to calculate mean for each image
var calcMean = function(img){

var mean = img.reduceRegion({
geometry: roi,

return img.set("mean_value",mean.get('ndvi'));

// add mean to properties
var NDVImean =;

// print the image collection

// filter based on NDVI mean
var NDVImeanSelect = NDVImean.filter("mean_value",0.29));

// print selection

Leave a Reply