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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s