I am trying to create a script and chart in GEE for NDVI time series for several years using
LANDSAT/LC08/C01/T1_32DAY_NDVI collection. I developed a short script using GEE library, but the chart shows only for one year instead (and I don't even know which year) of showing for all of them (I need to compare NDVI for different years for my study area):
https://code.earthengine.google.com/756d3ff7b718d91582535fd7669d0842
var countries = ee.FeatureCollection("FAO/GAUL/2015/level2");
var uzbekistan = countries.filter(ee.Filter.eq('ADM0_NAME','Uzbekistan'));
var bostanliq =uzbekistan.filter(ee.Filter.eq('ADM2_NAME','Bostanlik district'));
Map.addLayer(bostanliq, {}, "Bostanliq");
///
var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_32DAY_NDVI')
.filter(ee.Filter.or(
ee.Filter.date('2014-01-01', '2015-01-01'),
ee.Filter.date('2015-01-01', '2016-01-01'),
ee.Filter.date('2016-01-01', '2017-01-01'),
ee.Filter.date('2017-01-01', '2018-01-01')))
.filterBounds(bostanliq);
var dataset = dataset.select('NDVI');
var colorizedVis = {
min: 0,
max: 1,
palette: [
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
///
var chart =
ui.Chart.image
.doySeries({
imageCollection: dataset,
region: bostanliq,
regionReducer: ee.Reducer.mean(),
scale: 30,
yearReducer: ee.Reducer.mean(),
startDay: 1,
endDay: 365
})
.setOptions({
title: 'Average Vegetation Index Value by Day of Year for Bostanliq',
hAxis: {
title: 'Day of year',
titleTextStyle: {italic: false, bold: true}
},
vAxis: {
title: 'Vegetation index',
titleTextStyle: {italic: false, bold: true}
},
lineWidth: 3,
colors: ['1d6b99', '39a8a7', '9c4f97'],
});
print(chart);