diff --git a/sentinel-2/penguin_locator/index.md b/sentinel-2/penguin_locator/index.md index 0d9d37c4..398b9c18 100644 --- a/sentinel-2/penguin_locator/index.md +++ b/sentinel-2/penguin_locator/index.md @@ -8,7 +8,7 @@ nav_exclude: true examples: - zoom: '13' lat: '-73.33561' - lng: '-169.67045' + lng: '169.67045' datasetId: S2L2A fromTime: '2024-09-28T00:00:00.000Z' toTime: '2024-09-28T23:59:59.999Z' @@ -17,9 +17,6 @@ examples: evalscripturl: https://raw.githubusercontent.com/sentinel-hub/customScripts/master/sentinel-2/penguin_locator/script.js --- -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. - - ## General description of the script 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. diff --git a/sentinel-2/plastic_greenhouse/img/greenhouse_almeria.jpg b/sentinel-2/plastic_greenhouse/img/greenhouse_almeria.jpg new file mode 100644 index 00000000..90c6bc08 Binary files /dev/null and b/sentinel-2/plastic_greenhouse/img/greenhouse_almeria.jpg differ diff --git a/sentinel-2/plastic_greenhouse/index.md b/sentinel-2/plastic_greenhouse/index.md new file mode 100644 index 00000000..8506caa0 --- /dev/null +++ b/sentinel-2/plastic_greenhouse/index.md @@ -0,0 +1,54 @@ +--- +title: Plastic Greenhouse Index +parent: Sentinel-2 +grand_parent: Sentinel +layout: script +permalink: /sentinel-2/plastic_greenhouse/ +nav_exclude: true +examples: +- zoom: '12' + lat: '36.76703' + lng: '-2.71259' + datasetId: S2L2A + fromTime: '2025-08-10T00:00:00.000Z' + toTime: '2025-08-10T23:59:59.999Z' + platform: + - CDSE + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel/sentinel-2/plastic_greenhouse/script.js +--- + + +## Adding examples + +This page shows how example links can be added by defining the parameters in the [front matter](https://jekyllrb.com/docs/front-matter/). +An example is defined like this: + +```yaml +examples: +- zoom: '10' + lat: '42.76703' + lng: '11.22847' + datasetId: S2L2A + fromTime: '2020-07-12T00:00:00.000Z' + toTime: '2020-07-12T23:59:59.999Z' + platform: + - CDSE + - EOB + evalscripturl: https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel-2/ndvi/eob.js +``` + +## General description of the script + +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. + +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. + +## Description of representative images + +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. + +!['Sentinel-2 10 August 2025, in Almería, Spain'](./img/greenhouse_almeria.jpg) + +## References + +- 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) diff --git a/sentinel-2/plastic_greenhouse/script.js b/sentinel-2/plastic_greenhouse/script.js new file mode 100644 index 00000000..cd34913a --- /dev/null +++ b/sentinel-2/plastic_greenhouse/script.js @@ -0,0 +1,37 @@ +//VERSION=3 +function setup() { + return { + input: ["B02","B03", "B04", "B08", "dataMask"], + output:[ + { id: "default", bands: 3 }, + { id: "index", bands: 1, sampleType: "FLOAT32" }, + { id: "eobrowserStats", bands: 1, sampleType: "FLOAT32" }, + { id: "dataMask", bands: 1 } + ] + }; +} + +//setting constants +const minVal = 0; +const maxVal = 1.5; +const threshold = 0.13; +const opacity = 1; + +const visualizer = ColorGradientVisualizer.createBlueRed(minVal, maxVal); +visualizer.process(0.1) +visualizer.process(0.25) +visualizer.process(0.3) +visualizer.process(0.75) +visualizer.process(1.25) + +function evaluatePixel(sample) { + let index = (sample.B02 / (1 - ((sample.B02 + sample.B03 + sample.B08)/3))); + let color = visualizer.process(index); + let RGB = [2.5 * sample.B04, 2.5 * sample.B03, 2.5 * sample.B02]; + return { + default: (index > threshold) ? [color[0], color[1], color[2]] : RGB, + index: [index], + eobrowserStats: [index], + dataMask: [sample.dataMask] + }; +} \ No newline at end of file diff --git a/sentinel-2/sentinel-2.md b/sentinel-2/sentinel-2.md index 3fa6a18c..bcda4b0b 100644 --- a/sentinel-2/sentinel-2.md +++ b/sentinel-2/sentinel-2.md @@ -121,6 +121,7 @@ Dedicated to supplying data for [Copernicus services](https://www.esa.int/Our_Ac - [Pseudo forest canopy density (pseudo-FCD)](/sentinel-2/pseudo_forest_canopy_density) - [Infrared agriculture display](/sentinel-2/infrared_agriculture_display) - [Forest Disturbance Classification](/sentinel-2/forest_disturbance_classification) + - [Plastic Greenhouse Detection](/sentinel-2/plastic_greenhouse/) #### Marine and other water bodies environment algorithms - [Cyanobacteria chlorophyll-a from Sentinel-2](/sentinel-2/cyanobacteria_chla_ndci_l1c)