image collections 3

Calculate NDVI for each image in the collection

step 1: add a geometry to the map

step 2: copy the code below and fill out the ??

var l8 = ee.ImageCollection("??");

// filter for location
l8 = l8.filterBounds(??);

// print number of images
print(l8.size());

// filter for date;
l8 = l8.filterDate("2014-02-01","2018-12-31");

// print number of images
print(l8.size());

function removeClouds(image){

// get QA band
var QA = image.select("pixel_qa");
var shadow = QA.bitwiseAnd(8).neq(0);
var cloud = QA.bitwiseAnd(32).neq(0);
return image.updateMask(shadow.not()).updateMask(cloud.not());
}

function calculateNDVI(image){
return ndvi = image.normalizedDifference(['??','??'])
}

l8 = l8.map(??)
var ndvi = l8.map(??).??

Map.addLayer(ndvi,min:??,max:??,palette:"???"},"ndvi")

 

 

Leave a Reply