Filter image collection

Filter on time and location

Step 1:
Add a marker to the map

geom
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
Map.addLayer(img,{min:0,max:3000,bands:"B4,B3,B2"},"image");

link

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s