-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PlanetScope true color: use dataMask to make no-data pixels transparent * PlanetScope false color: use dataMask to make no-data pixels transparent * PlanetScope NDWI simple visualization: use dataMask to make no-data pixels transparent * PlanetScope NDWI raw values: add script * PlanetScope NDWI EOB visualization: add script * PlanetScope NDWI: add scripts to readme.md * add dataMask only at the end for PS NDWI script * rename samples to sample in PS NDWI script * remove unused dataMask band in PS NDWI raw script * avoid returning infinite number in PS NDWI raw script * rename samples to sample in PS NDWIeob script * add dataMask only at the end for PS NDWI eob script * avoid returning infinite number in PS NDWI eob script * rename samples to sample in PS NDWIraw script * improve eob script for PS NDWI --------- Co-authored-by: Jonas <[email protected]>
- Loading branch information
1 parent
9090f77
commit 524f538
Showing
4 changed files
with
49 additions
and
17 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//VERSION=3 | ||
//NDWI | ||
|
||
function setup() { | ||
return { | ||
input: [{ bands: ["green", "nir"] }], | ||
output: [ | ||
{ id: "default", bands: 1, sampleType: "FLOAT32" }, | ||
] | ||
} | ||
} | ||
|
||
function evaluatePixel(sample) { | ||
let ndwi = index(sample.green, sample.nir); | ||
return { default: [isFinite(ndwi) ? ndwi : NaN] }; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
//VERSION=3 | ||
//NDWI | ||
|
||
let ndwi = index(green, nir); | ||
function setup() { | ||
return { | ||
input: [{ bands: ["green", "nir", "dataMask"] }], | ||
output: [ | ||
{ id: "default", bands: 4 }, | ||
] | ||
} | ||
} | ||
|
||
return colorBlend(ndwi, | ||
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0], | ||
[ | ||
[1, 0, 1], | ||
[1, 0.5, 0], | ||
[1, 1, 0], | ||
[0.2, 1, 0.5], | ||
[0, 0, 1], | ||
[0, 0, 0.3], | ||
[0, 0, 0], | ||
] | ||
); | ||
function evaluatePixel(sample) { | ||
let ndwi = index(green, nir); | ||
|
||
let id_default = colorBlend(ndwi, | ||
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0], | ||
[ | ||
[1, 0, 1], | ||
[1, 0.5, 0], | ||
[1, 1, 0], | ||
[0.2, 1, 0.5], | ||
[0, 0, 1], | ||
[0, 0, 0.3], | ||
[0, 0, 0], | ||
] | ||
); | ||
|
||
return { default: [...id_default, sample.dataMask] }; | ||
} |
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