//VERSION=3//This custom script visualises the seasonality layer according to the data user guide.//Set up input and output settingsfunctionsetup(){return{input:["seasonality"],output:{bands:3,sampleType:"AUTO"}}}//Create color rampconstramps=[[1,0x99d9ea],//1 month of water (Very soft cyan)[12,0x0000aa]//12 months of water - permanent water (Dark blue)];//Create visualizerconstvisualizer=newColorRampVisualizer(ramps);//EvaluatePixel functionfunctionevaluatePixel(sample){if(sample.seasonality==0){//Not waterreturn[1,1,1]//Return White}elseif(sample.seasonality>12){//No datareturn[0.8,0.8,0.8]//Return Light gray}elseif(sample.seasonality>0&&sample.seasonality<=12){//1 - 12 month of waterreturn[visualizer.process(sample.seasonality)[0],visualizer.process(sample.seasonality)[1],visualizer.process(sample.seasonality)[2]];//Return color ramp values}}
General description of the script
This script visualizes the Seasonality layer from the Global Surface Water dataset according to the official symbology (Table 1). The Seasonality layer provides information on the intra-annual distribution of surface water in the selected review year.
Table 1: Seasonality Symbology
Value
Symbol
Colour
Label
0
0xffffff
Not water
1
0x99d9ea
1 month of water
12
0x0000aa
12 months of water (permanent water)
255
0xcccccc
No data
Description of representative images
Eo Browser visualisation of surface water Seasonality in the world’s largest salt flat Salar de Uyuni in southwest Bolivia.