forked from sentinel-hub/custom-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
45 lines (42 loc) · 761 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//VERSION=3
//UDM2 Classification
function setup() {
return {
input: [{
bands: [
"B1",
"B2",
"B3",
"UDM2_Clear",
"UDM2_Snow",
"UDM2_Shadow",
"UDM2_LightHaze",
"UDM2_HeavyHaze",
"UDM2_Cloud"
]
}],
output: {
bands: 4
}
}
}
function evaluatePixel(samples) {
if (samples.UDM2_Snow == 1){
return[0,0.5,1,1] // blue
}
if (samples.UDM2_Shadow == 1){
return[0.4,0.4,0.4,1] //grey
}
if (samples.UDM2_LightHaze == 1){
return[0,0.9,1,1] //sky blue
}
if (samples.UDM2_HeavyHaze == 1){
return[1,0.7,1,1] //light pink
}
if (samples.UDM2_Cloud == 1){
return[0.7,0.7,0.7,1] //white
}
else{
return[0,0,0,0]
}
}