Skip to content

Commit 40ccdb3

Browse files
authored
Merge pull request #357 from azlinszkysinergise/plastic_greenhouse
new script: plastic greenhouse and corrections in penguin locator
2 parents 71d75d8 + a18053d commit 40ccdb3

File tree

5 files changed

+93
-4
lines changed

5 files changed

+93
-4
lines changed

sentinel-2/penguin_locator/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nav_exclude: true
88
examples:
99
- zoom: '13'
1010
lat: '-73.33561'
11-
lng: '-169.67045'
11+
lng: '169.67045'
1212
datasetId: S2L2A
1313
fromTime: '2024-09-28T00:00:00.000Z'
1414
toTime: '2024-09-28T23:59:59.999Z'
@@ -17,9 +17,6 @@ examples:
1717
evalscripturl: https://raw.githubusercontent.com/sentinel-hub/customScripts/master/sentinel-2/penguin_locator/script.js
1818
---
1919

20-
The layout `script` automatically adds the title defined in the front matter and adds buttons to visualize the script. For the buttons to work the evalscript has to be named `script.js` and must be in the same directory as the `README.md` file.
21-
22-
2320
## General description of the script
2421

2522
This script aims to highlight small patterns in landscapes dominated by ice and snow. It does this by first square root transforming all bands, then adding the NIR band to the red channel (more sensitive to ice thickness and wetness than the visible bands), and calculating the differences between the red and green, and green and blue Sentinel-2 image bands respectively and assigning these to the green and blue channels of the visualized image. The result speaks for itself: subtle patterns in snow and ice cover are revealed, and objects on the surface such as penguin poop stand out, easy to notice.
391 KB
Loading
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Plastic Greenhouse Index
3+
parent: Sentinel-2
4+
grand_parent: Sentinel
5+
layout: script
6+
permalink: /sentinel-2/plastic_greenhouse/
7+
nav_exclude: true
8+
examples:
9+
- zoom: '12'
10+
lat: '36.76703'
11+
lng: '-2.71259'
12+
datasetId: S2L2A
13+
fromTime: '2025-08-10T00:00:00.000Z'
14+
toTime: '2025-08-10T23:59:59.999Z'
15+
platform:
16+
- CDSE
17+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel/sentinel-2/plastic_greenhouse/script.js
18+
---
19+
20+
21+
## Adding examples
22+
23+
This page shows how example links can be added by defining the parameters in the [front matter](https://jekyllrb.com/docs/front-matter/).
24+
An example is defined like this:
25+
26+
```yaml
27+
examples:
28+
- zoom: '10'
29+
lat: '42.76703'
30+
lng: '11.22847'
31+
datasetId: S2L2A
32+
fromTime: '2020-07-12T00:00:00.000Z'
33+
toTime: '2020-07-12T23:59:59.999Z'
34+
platform:
35+
- CDSE
36+
- EOB
37+
evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel-2/ndvi/eob.js
38+
```
39+
40+
## General description of the script
41+
42+
A simple spectral index for the detection of plastic greenhouses and agricultural foil, based on the Retrogressive Plastic Greenhouse Index developed by Ibrahim et al (2021). Plastic foil reflects strongly in Band 2 (Blue) of Sentinel-2, which is compared against the mean of bands 3 (green), 4 (red) and 8 (near infrared). Detection is not perfect - bare soil areas are sometimes mistaken.
43+
44+
The script assigns a blue to red palette to values of the retrogressive plastic greenhouse index that exceed a certain threshold, and true color to the rest of the pixels.
45+
46+
## Description of representative images
47+
48+
Plastic Greenhouse Index map of the "Sea of Plastic", an area dominated by plastic greenhouses in the Almería region of Spain. As you can see, the index is not selective to land cover (bare soil and coastal areas are labelled), but can be used to separate open and greenhouse horticulture and can contribute to agricultural mapping.
49+
50+
!['Sentinel-2 10 August 2025, in Almería, Spain'](./img/greenhouse_almeria.jpg)
51+
52+
## References
53+
54+
- Ibrahim, Elsy, and Anne Gobin. "Sentinel-2 recognition of uncovered and plastic covered agricultural soil." Remote Sensing 13, no. 21 (2021): 4195. [Link](https://www.mdpi.com/2072-4292/13/21/4195)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//VERSION=3
2+
function setup() {
3+
return {
4+
input: ["B02","B03", "B04", "B08", "dataMask"],
5+
output:[
6+
{ id: "default", bands: 3 },
7+
{ id: "index", bands: 1, sampleType: "FLOAT32" },
8+
{ id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" },
9+
{ id: "dataMask", bands: 1 }
10+
]
11+
};
12+
}
13+
14+
//setting constants
15+
const minVal = 0;
16+
const maxVal = 1.5;
17+
const threshold = 0.13;
18+
const opacity = 1;
19+
20+
const visualizer = ColorGradientVisualizer.createBlueRed(minVal, maxVal);
21+
visualizer.process(0.1)
22+
visualizer.process(0.25)
23+
visualizer.process(0.3)
24+
visualizer.process(0.75)
25+
visualizer.process(1.25)
26+
27+
function evaluatePixel(sample) {
28+
let index = (sample.B02 / (1 - ((sample.B02 + sample.B03 + sample.B08)/3)));
29+
let color = visualizer.process(index);
30+
let RGB = [2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02];
31+
return {
32+
default: (index > threshold) ? [color[0], color[1], color[2]] : RGB,
33+
index: [index],
34+
eobrowserStats: [index],
35+
dataMask: [sample.dataMask]
36+
};
37+
}

sentinel-2/sentinel-2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Dedicated to supplying data for [Copernicus services](https://www.esa.int/Our_Ac
121121
- [Pseudo forest canopy density (pseudo-FCD)](/sentinel-2/pseudo_forest_canopy_density)
122122
- [Infrared agriculture display](/sentinel-2/infrared_agriculture_display)
123123
- [Forest Disturbance Classification](/sentinel-2/forest_disturbance_classification)
124+
- [Plastic Greenhouse Detection](/sentinel-2/plastic_greenhouse/)
124125

125126
#### Marine and other water bodies environment algorithms
126127
- [Cyanobacteria chlorophyll-a from Sentinel-2](/sentinel-2/cyanobacteria_chla_ndci_l1c)

0 commit comments

Comments
 (0)