0

I have this code, which I use to plot an NDVI time series for a geometry with Landsat 8. However, I would like to create a time series from 1985-2019, which requires Landsat 5 and 7. How can I modify this code to create a timeseries across both of these satellites?

https://code.earthengine.google.com/45279499e5eda83d7321c9758fb70425

var rgb_vis = {min:0, max:0.3, bands:['B4','B3','B2']}; 
function addNDVI(image) {
  var ndvi = image.normalizedDifference(['B5', 'B4']);
  return image.addBands(ndvi);
}
var filtered = L8.filterDate('2016-01-01', '2019-10-30');
var with_ndvi = filtered.map(addNDVI);
var greenest = with_ndvi.qualityMosaic('nd');
Map.addLayer(filtered.median(), rgb_vis, 'RGB (median)');
Map.addLayer(greenest, rgb_vis, 'RGB (greenest pixel)');
print(Chart.image.series(with_ndvi.select('nd'), roi));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.