TransWikia.com

Sentinel-2 clouds filtering in GEE

Geographic Information Systems Asked by Salvatore Praticò on July 15, 2021

I need to filter a Sentinel-2 image collection in order to have almost no clouds.
I used the following code:

//Dates of interest
var START = ee.Date('2017-03-28');
var FINISH = ee.Date('2020-07-31');    
//Merge different plot
var Plot = Plot01.merge(Plot02);

//Create ImageCollection    
var ImageCollection = ee.ImageCollection(S2L2A)    
.filterDate(START,FINISH)    
//Filter data by location    
.filterBounds(Plot)    
//Filter data based on metadata property -> cloudy pixel percentage <5%    
.filterMetadata('CLOUDY_PIXEL_PERCENTAGE', 'less_than', 5)    
//Return clipped image    
.map(function(image){return image.clip(Plot)})

The filter of cloudy pixel percentage <5% refers to the entire Sentinel-2 tile. How can I perform this filtering process referring just to my Plot?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP