I want to to calculate NDVI time series from 2015 to 2018 using Landsat 7 and get the maximum NAVI value in this period and it's corresponding image index. That is, the horizontal and vertical axes value of this picture, I want to get the Image index in Google Earth Engine, not the time.
code
var landsat7_SR = ee.ImageCollection("LANDSAT/LE07/C01/T1_SR")
.filterBounds(geometry);
var ndvi_list = landsat7_SR.filterDate("1999-01-01", "2018-04-30")
.map(function(image) {
var ndvi=image.expression('float(b("B4") - b("B3")) / (b("B4") + b("B3"))').rename('ndvi');
return image.addBands(ndvi);
});
Best Answer
To get the maximum
ndvi
you could usequalityMosaic
function. To be able to know which image ID the pixel comes from is more complicated because as it is not a numerical property, you have to encode it some how. This is how I'd do it, but it's just one way, there could be other ways (may be easier)