//------------------------------------------------------ //DESCRIPTION //------------------------------------------------------ /* Simple dashboard to select reservoirs in Zarafshan Province in Uzbekistan. After selecting a year the user can display the Water Occurence Frequency within the area of interest. The user can also select individual Sentinel-2 scenes to display RGB satellite images and the shoreline at the selected date. Furthermore, this script can be used to iterate over many water bodies for exporting associated Water Occurence Images as Assets */ //------------------------------------------------------ // 1. Parameters //------------------------------------------------------ //Analysis period of Water Occurence maps to be exported: var start_date_4export = ee.Date.fromYMD(2017,1,1); var end_date_4export = ee.Date.fromYMD(2022, 12, 31); //cloud and nodata thresholds var cc_thresh = 5; var cc_pix=10; var nodata_thresh = 10; //water surface mapping parameters: var cannyThreshold = 0.7; var cannySigma = 0.7; var minValue = -0.3; var scale=30; var maxValue=0.3; var mndwi_thresh=-0.3; var buffer = 500; //------------------------------------------------------ // 2. Selection of Water Bodies //------------------------------------------------------ var Lakes = ee.FeatureCollection("projects/ee-adriankreinerak/assets/Lakes_combination_v5"); //Select the water bodies that should be considered for the analysis. var Lakes_Zarafshan=Lakes.map(function(feat){ return ee.Feature(feat).set('Name',ee.String('ID_').cat(ee.Number.parse(feat.get('fid'))));//Define a name for each reservoir }); //Get the list of IDs of selected water bodies (client side) var allids=Lakes_Zarafshan.aggregate_array('fid').getInfo(); print('IDs of selected water bodies',allids); //define asset paths and name var freqMapName='SurfWaterFreq_S2_17to22_';//frequency map export base name //asset path for frequency maps: var path_Freq = 'projects/ee-adriankreinerak/assets/SurfFreqMaps_Lakes_combination_v2'; // ****************************************************************************************************************** // // GET LIST OF IDs FOR SPECIFIC DATA TYPES // ****************************************************************************************************************** // // get the list of Images already exported: var Table = ee.data.listAssets(path_Freq); var l;//number of exported images if (Table.assets===null){ l=0; } else { l =Table.assets.length; } print('number of already exported images',l); print(Table.assets) //get the list of IDs of exported Water Occurence images (client side variable) var tableids=[]; for (var i=0; i0){ select_another_date(selected_year); } } }).setPlaceholder('ID_'+allids[0]); //Define elements for water body selection drop down list var names=[]; for (var i = 0; i