1

I would like to keep in Landsat 8 32-Day NDVI Composite imageCollection one layer in decembre between 2014 and 2017. Is there any way to do a variable filter ? Or a filter on month ?

delaye
  • 1,357
  • 27
  • 45

1 Answers1

5

For filtering a specific month, you can use ee.Filter.calendarRange within the filter method of the ImageCollection:

var collection = ee.ImageCollection('LANDSAT/LC8_L1T_32DAY_NDVI')
.filter(ee.Filter.calendarRange(12,12,'month'));

The result gives you an ImageCollection containing the following images:

0: Image LANDSAT/LC8_L1T_32DAY_NDVI/20131219 (1 band)
1: Image LANDSAT/LC8_L1T_32DAY_NDVI/20141219 (1 band)
2: Image LANDSAT/LC8_L1T_32DAY_NDVI/20151219 (1 band)
3: Image LANDSAT/LC8_L1T_32DAY_NDVI/20161218 (1 band)

As to selecting a specific image, you can either do the same filtering on the year or convert the ImageCollection to a list and select the image you want.

HTH

Val
  • 6,585
  • 5
  • 22
  • 52