2

I'm trying to get cloud and shadow-free (or as close to cloud free) scenes for Landsat 8, NAIP, and Sentinel 2 (specifically sentinel 2 10 meter resolution), and then apply the NDVI calculation to each set.

After that, I'd like to look at those values within specific polygon geometries I've created, but that's a separate thing I'd like to try on my own first!

I'm fairly new to GEE, and though I've watched the tutorials I still have some trouble with basic things it seems.

Here is just the portion I have so far for Landsat 8, though it's not running error-free.

// add three imagery layers to neighborhoods and filter date
var l8filtered = landsat8.filterDate('2016-10-01', '2016-10-31'); 
                         .sort('CLOUD_COVER');
                         .first());

// send to console/add to map
print(l8filtered, "l8 filter")
Map.addLayer(l8filtered,{},"L8")

//create NDVI image
var l8_ndvi = l8filtered.normalizedDifference(['B5','B4']);
Map.addLayer(l8_ndvi,{min:-0.1, max:0.1, palette:['FFFFFF', '339900']},'L8 NDVI');

For the cloud shadow - I've been sleuthing a did come across this post, however it's not quite making sense to me.

For the Landsat 8 imagery specifically - am I right in defining the bands in the l8_ndvi variable, or should I be calling the bands out before that?

0

1 Answer 1

1

I have finished this! Here's the link to the code if anyone is curious: https://code.earthengine.google.com/64f258f80593984dc9ed946dba11a8ab

I had trouble clipping the calculations to my geometry layer at first, and also realized that the cloudmask and ndvi functions I had in there were trying to go off of an Image vs. an ImageCollection like I had for L8 and S2 data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.