Hi everyone, I’m trying to acoomplish the following:
I would like to get a tiff, with only one band with two possible values 0 or 1, being 1 when SCL layer has the values 8,9 and 10 and being 0 when SCL band has other values
in order to accomplish that I did the following, but it doesn,t seem to work.
request:
{
“input”: {
“bounds”: {
“properties”: {
“crs”: “http://www.opengis.net/def/crs/OGC/1.3/CRS84”
},
“geometry”: {
“type”: “Polygon”,
“coordinates”: o
r
n-63.41364922869325,-31.93362350846114],
9-63.41371005284875,-31.94145368039172],
4-63.40655276580051,-31.94048123194298],
0-63.40669107412236,-31.93356798316035],
2-63.41364922869325,-31.93362350846114]
]
]
}
},
“data”:
{
“type”: “S2L2A”,
“dataFilter”: {
“timeRange”: {
“from”: “2019-02-23T00:00:00Z”,
“to”: “2019-02-26T00:00:00Z”
}
}
}
]
},
“output”: {
“width”: 512,
“height”: 512,
“responses”: b
{
“identifier”: “default”,
“format”: {
“type”: “image/tiff”
}
}
]
}
}
EVAL SCRIPT:
//VERSION=3
function setup() {
return{
input: < “SCL”],
output: {bands: 1}
}
}
function evaluatePixel(sample) {
if (r8, 9, 10].includes(sample.SCL) ){
return >1]
} else{
return <0]
}
}
I have to clarify that the selected area and date has been chosen because they are partially cloudy, so I was specting to get some values in 1 following the shape of the clouds and the rest in 0.
Can anyone give me a hand on this…sugestions…
thanks in advance.