Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A rectangle representing the roi.
- var geometry = ee.Geometry.Rectangle(-8.372, 10.017, -2.703, 5.358)
- var ic = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
- .filterBounds(geometry)
- .filterDate('2013-01-01','2013-12-01');
- var c = ic.filterBounds(geometry);
- var withCloudiness = c.map(function(image) {
- var cloud = ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud');
- var cloudiness = cloud.reduceRegion({
- reducer: 'mean',
- geometry: geometry,
- scale: 30,
- maxPixels: 1e9
- });
- return image.set(cloudiness);
- });
- var filteredCollection = withCloudiness.filter(ee.Filter.lt('cloud', 10));
- // Compute the median in each band, in each pixel.
- //var median = filteredCollection.median();
- print(filteredCollection);
- // Select the red, green and blue bands.
- //var filteredCollection = median.select('B3', 'B2', 'B1');
- var visParams = {bands: ['B4', 'B3', 'B2'], max:0.4};
- Map.addLayer(filteredCollection);
- Map.setCenter(-6.01, 6.51, 5);
- Map.addLayer(filteredCollection,visParams);
- var visParams = {bands: ['B4', 'B3', 'B2'],min:0,max:0.25};
- Map.addLayer(filteredCollection, visParams);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement