Hello SH Community,
I want to create a data fusion product based on the below script, but there are always 0 or 255 values in the DEM layer. What am I doing wrong?
//VERSION=3
function setup() {
return {
input: [
{
bands: [“B01”,“B04”,“B07”,“B09”,“B11”,“B08”,“B05”,“B02”,“CLM”,“SCL”,“B12”,“B8A”,“B06”,“B03”],
units: “DN”,
datasource:“s2l2a”
},
{
bands: [“DEM”],
datasource:“dem30”
}
],
output: [
{
id: “default”,
bands: 4,
sampleType: “AUTO”,
},
],
mosaicking: “SIMPLE”,
};
}
function evaluatePixel(samples) {
var S2L2A = samples.s2l2a[0];
var DEM30 = samples.dem30[0];
var NDVI = ((S2L2A.B08 - S2L2A.B04) / (S2L2A.B08 + S2L2A.B04));
var NDRE = ((S2L2A.B09 - S2L2A.B05) / (S2L2A.B09 + S2L2A.B05));
var NDII = ((S2L2A.B08 - S2L2A.B11) / (S2L2A.B08 + S2L2A.B11));
return {
default: [S2L2A .SCL, S2L2A .CLM, NDVI, NDRE, NDII, DEM30.DEM],
};
}