Filter image collection

Filter on time and location

Step 1:
Add a marker to the map

Step 2:
Copy and run the code below

// import image colletion
var l8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR").sort("CLOUD_COVER");

// define dates
var startDate = ee.Date.fromYMD(2018,1,1);
var endDate = ee.Date.fromYMD(2018,6,1);

// apply the filters
var l8 = l8.filterDate(startDate,endDate) // filter date
.filterBounds(geometry); // filter location

// get the first image
var img = ee.Image(l8.first());

// add image to map


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s