Skip to content

Commit 4477bcf

Browse files
author
Jonas Viehweger
committed
Integrated back rebased files
1 parent 83ee105 commit 4477bcf

File tree

7 files changed

+41
-163
lines changed

7 files changed

+41
-163
lines changed

planet/planetscope/ndvi/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ examples:
1717
toTime: '2023-04-19T23:59:59.999Z'
1818
platform:
1919
- EOB
20-
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/ndvi/eob.js
20+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/ndvi/eob.js
2121
additionalQueryParams:
2222
- - themeId
2323
- PLANET_SANDBOX

planet/planetscope/ndvi_difference/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ examples:
1515
- zoom: '14'
1616
lat: '52.24714'
1717
lng: '9.20886'
18-
datasetId: Planetscope
18+
datasetId: 'ccb1f8f0-e5bf-4c31-afe5-d8803bcbde2a'
1919
fromTime: '2023-04-02T00:00:00.000Z'
2020
toTime: '2023-06-01T23:59:59.999Z'
2121
platform:

planet/planetscope/ndwi/eob.js

+34-36
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,44 @@
22
//PlanetScope NDWI EO Browser
33

44
function setup() {
5-
return {
6-
input: [{
7-
bands: [
8-
"green",
9-
"nir",
10-
"dataMask",
11-
"clear"]
12-
}],
13-
output: [
14-
{ id: "default", bands: 4 },
15-
{ id: "index", bands: 1, sampleType: "FLOAT32" },
16-
{ id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" },
17-
{ id: "dataMask", bands: 1 },
18-
]
19-
}
5+
return {
6+
input: [
7+
{
8+
bands: ["green", "nir", "dataMask", "clear"],
9+
},
10+
],
11+
output: [
12+
{ id: "default", bands: 4 },
13+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
14+
{ id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" },
15+
{ id: "dataMask", bands: 1 },
16+
],
17+
};
2018
}
2119

2220
function evaluatePixel(sample) {
21+
let ndwi = index(sample.green, sample.nir);
2322

24-
let ndwi = index(sample.green, sample.nir)
23+
const clear = sample.dataMask && sample.clear;
2524

26-
const clear = sample.dataMask && sample.clear;
25+
let ndwi_colored = colorBlend(
26+
ndwi,
27+
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
28+
[
29+
[1, 0, 1],
30+
[1, 0.5, 0],
31+
[1, 1, 0],
32+
[0.2, 1, 0.5],
33+
[0, 0, 1],
34+
[0, 0, 0.3],
35+
[0, 0, 0],
36+
]
37+
);
2738

28-
let ndwi_colored = colorBlend(ndwi,
29-
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
30-
[
31-
[1, 0, 1],
32-
[1, 0.5, 0],
33-
[1, 1, 0],
34-
[0.2, 1, 0.5],
35-
[0, 0, 1],
36-
[0, 0, 0.3],
37-
[0, 0, 0],
38-
]
39-
);
40-
41-
return {
42-
default: [...ndwi_colored, clear],
43-
index: [ndwi],
44-
eobrowserStats: [ndwi, !clear],
45-
dataMask: [sample.dataMask],
46-
};
39+
return {
40+
default: [...ndwi_colored, clear],
41+
index: [ndwi],
42+
eobrowserStats: [ndwi, !clear],
43+
dataMask: [sample.dataMask],
44+
};
4745
}

planet/planetscope/ndwi/script.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
function setup() {
55
return {
66
input: [{ bands: ["green", "nir", "dataMask"] }],
7-
output: [
8-
{ id: "default", bands: 4 },
9-
]
10-
}
7+
output: [{ id: "default", bands: 4 }],
8+
};
119
}
1210

1311
function evaluatePixel(sample) {
14-
let ndwi = index(green, nir);
12+
let ndwi = index(sample.green, sample.nir);
1513

16-
let id_default = colorBlend(ndwi,
14+
let id_default = colorBlend(
15+
ndwi,
1716
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
1817
[
1918
[1, 0, 1],

planet_scope/ndvi/README.md

-46
This file was deleted.

planet_scope/ndvi_difference/README.md

-43
This file was deleted.

planet_scope/ndwi/script.js

-30
This file was deleted.

0 commit comments

Comments
 (0)