Skip to content

Commit

Permalink
Integrated back rebased files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Viehweger committed Nov 27, 2024
1 parent 83ee105 commit 4477bcf
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 163 deletions.
2 changes: 1 addition & 1 deletion planet/planetscope/ndvi/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ examples:
toTime: '2023-04-19T23:59:59.999Z'
platform:
- EOB
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet/planetscope/ndvi/eob.js
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/planet_scope/ndvi/eob.js
additionalQueryParams:
- - themeId
- PLANET_SANDBOX
Expand Down
2 changes: 1 addition & 1 deletion planet/planetscope/ndvi_difference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ examples:
- zoom: '14'
lat: '52.24714'
lng: '9.20886'
datasetId: Planetscope
datasetId: 'ccb1f8f0-e5bf-4c31-afe5-d8803bcbde2a'
fromTime: '2023-04-02T00:00:00.000Z'
toTime: '2023-06-01T23:59:59.999Z'
platform:
Expand Down
70 changes: 34 additions & 36 deletions planet/planetscope/ndwi/eob.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,44 @@
//PlanetScope NDWI EO Browser

function setup() {
return {
input: [{
bands: [
"green",
"nir",
"dataMask",
"clear"]
}],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: "FLOAT32" },
{ id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" },
{ id: "dataMask", bands: 1 },
]
}
return {
input: [
{
bands: ["green", "nir", "dataMask", "clear"],
},
],
output: [
{ id: "default", bands: 4 },
{ id: "index", bands: 1, sampleType: "FLOAT32" },
{ id: "eobrowserStats", bands: 2, sampleType: "FLOAT32" },
{ id: "dataMask", bands: 1 },
],
};
}

function evaluatePixel(sample) {
let ndwi = index(sample.green, sample.nir);

let ndwi = index(sample.green, sample.nir)
const clear = sample.dataMask && sample.clear;

const clear = sample.dataMask && sample.clear;
let ndwi_colored = 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],
]
);

let ndwi_colored = 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: [...ndwi_colored, clear],
index: [ndwi],
eobrowserStats: [ndwi, !clear],
dataMask: [sample.dataMask],
};
return {
default: [...ndwi_colored, clear],
index: [ndwi],
eobrowserStats: [ndwi, !clear],
dataMask: [sample.dataMask],
};
}
11 changes: 5 additions & 6 deletions planet/planetscope/ndwi/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
function setup() {
return {
input: [{ bands: ["green", "nir", "dataMask"] }],
output: [
{ id: "default", bands: 4 },
]
}
output: [{ id: "default", bands: 4 }],
};
}

function evaluatePixel(sample) {
let ndwi = index(green, nir);
let ndwi = index(sample.green, sample.nir);

let id_default = colorBlend(ndwi,
let id_default = colorBlend(
ndwi,
[-1, -0.5, -0.2, 0, 0.2, 0.5, 1.0],
[
[1, 0, 1],
Expand Down
46 changes: 0 additions & 46 deletions planet_scope/ndvi/README.md

This file was deleted.

43 changes: 0 additions & 43 deletions planet_scope/ndvi_difference/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions planet_scope/ndwi/script.js

This file was deleted.

0 comments on commit 4477bcf

Please sign in to comment.