While trying to customize NDVI coloring, we got a trouble not to visualize accurately as returned from evaluatePixcel function. When simplified as follows, we finally found a specific point that might bring a problem. When returned code[0] from evaluatePixel(), the preview becomes a perfect yellow; however, code[1] brings absolute white. There is only a little difference between 2 arrays. Why is this happened on code[1]? How could we get a correct color from code[1]?
We are in great trouble for this. What we need is to make a precise customization according to NDVI value from B04 and B08. Thank you for the quick help.
//VERSION=3
function evaluatePixel(samples) {
let code = [[255,255,0], [255,255,1]];
return code[0];
}
function setup() {
return {
input: [{
bands: [
“B04”,
“B08”
]
}],
output: {
bands: 3
}
}
}