Created
January 26, 2022 15:08
-
-
Save maximlamare/9695976fd86d7024ba7b693cba0b15ad to your computer and use it in GitHub Desktop.
How to return NDVI as UINT 16 in an Evalscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VERSION=3 | |
function setup() { | |
return { | |
input: ["B04", "B08"], | |
output: { bands: 1, sampleType: "UINT16" } | |
}; | |
} | |
function evaluatePixel(sample) { | |
let ndvi = index(sample.B08, sample.B04); | |
return [10000 * ndvi + 10000]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment