Path: blob/master/examples/javascripts/ClippedComposite.js
2313 views
// Composite an image collection and clip it to a boundary.12// Load Landsat 7 raw imagery and filter it to April-July 2000.3var collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')4.filterDate('2000-04-01', '2000-07-01');56// Reduce the collection by taking the median.7var median = collection.median();89// Load a table of state boundaries and filter.10var fc = ee.FeatureCollection('TIGER/2016/States')11.filter(ee.Filter.or(12ee.Filter.eq('NAME', 'Nevada'),13ee.Filter.eq('NAME', 'Arizona')));1415// Clip to the output image to the Nevada and Arizona state boundaries.16var clipped = median.clipToCollection(fc);1718// Display the result.19Map.setCenter(-110, 40, 5);20var visParams = {bands: ['B3', 'B2', 'B1'], gain: [1.4, 1.4, 1.1]};21Map.addLayer(clipped, visParams, 'clipped composite');222324