Sentinel 2 biodiversity

Overview
Creative Commons License: CC-BY Questions:
  • How to get spectral and biodiversity indicators from remote sensing data ?

  • Which kind of ecosystem are you studying ? global or canopy data ?

Objectives:
  • Getting Sentinel 2 data and reformatting them in a generalized way

  • Computing spectral indices such as the NDVI

  • Calculating and visualizing biodiversity indicators

  • Comparing with in-situ data

Requirements:
Time estimation: 48 hours
Supporting Materials:
Published: Apr 13, 2023
Last modification: Jan 19, 2024
License: Tutorial Content is licensed under Creative Commons Attribution 4.0 International License. The GTN Framework is licensed under MIT
purl PURL: https://gxy.io/GTN:T00333
version Revision: 35

This tutorial will guide you on getting Sentinel 2 data and processing them in order to calculate and visualize biodiversity indicators. This workflow made of 6 tools will allow you to explore Sentinel 2 data in the view of making biodiversity analyses.

Spatial diversity measurements should not replace in situ biodiversity data, but rather complement existing data and approaches. Spatial diversity estimates are currently based on long time scales, allowing more general predictions about rates of change in diversity. In practice, spatial data incorporate information on surface properties, including functional aspects, taxonomy, phylogeny and genetic diversity. 

The tools explained here are useful for observing variations in spatial and temporal ecosystem properties given the intrinsic relationship between spatial variations in ecosystems and pixel values of spectral signals. A single measurement cannot provide a complete description of all the different aspects of ecosystem heterogeneity. Therefore, the combination of multiple tools in a Galaxy-Ecology workflow offers multiple approaches to unravel the complexity of ecosystem heterogeneity in space and time.

So, we will compute biodiversity and spectral indices mainly using reflectance information.

The reflectance is a proportion on reflected light on an area. It’s the ratio between the electromagnetic incident wave on the area and the reflected wave. It’s often a percentage between reflected intensity and incident intensity assumed as energy quantity.

Sentinel 2 toolsuite workflow: from the dowload of the data to the production of biodiversity indicators. Open image in new tab

Figure 1: Sentinel 2 toolsuite workflow

Each part of this workflow has elementary steps :

  • A first step to preprocess Sentinel 2 data:
    • Preprocess Sentinel 2 data
  • A second step to compute biodiversity indicators
    • Global overview
    • For Canopy
  • A third step to compute spectral indices:
    • Spectral indices
    • EBV

Spectral indices are used to highlight particular features or properties of the earth’s surface, e.g. vegetation, soil, water. They are developed on the basis of the spectral properties of the object of interest.

Knowledge of the leaf cell, plant structure, state, condition and spectral properties is essential to perform vegetation analysis using remote sensing data.   Spectral indices dedicated to vegetation analysis are developed on the basis that healthy vegetation reflects strongly in the near infrared (NIR) spectrum while absorbing strongly in the visible red.  

In this tutorial, we’ll be working on Sentinel 2 data extracted from the Theia Land portal. First those data will be prepared. After pre-processing to fit the input format of the tools, we’ll see how to calculate biodiversity metrics.

Agenda

In this tutorial, we will cover:

  1. Upload and pre-processing of the data
  2. Preparing data
    1. Preprocessing sentinel 2 data
  3. Producing biodiversity indicators
    1. Compute a PCA
    2. Compute biodiversity indices
    3. Compute a PCA
    4. Create Biodiversity maps
    5. Processing remote sensing data
  4. Spectral indices
  5. Conclusion
Warning: It can take a bit of time

As your processing heavy data some of the steps can take some time. Notably, the step Create Biodiversity maps can run for 2 days. We advise to let it run and proceed with the tutorial. Once, the pre-processing part is done all the steps can be done separately. Thus, no need for you to wait the end of each tool before running another one.

Upload and pre-processing of the data

This first step consist of downloading and properly prepare the data to use it in Sentinel 2 toolsuite.

Hands-on: Data upload
  1. Create a new history for this tutorial and give it a name (example: “Sentinel 2 data for biodiversity tutorial”) for you to find it again later if needed.

    Click the new-history icon at the top of the history panel:

    UI for creating new history

  2. Download the files from Scihub, PEPS or Theia :

    You will have to to create an account for either of these platform. Select Reflectance, Sentinel 2 and “Niveau 2A” (level 2A).

    Theia portal welcome page. Open image in new tab

    Figure 2: Theia portal

    This an example of the Theia land portal. You need to download a zip folder. Keep it that way.

  3. Upload the zip folder

    1. Click on Upload Data on the top of the left panel
    2. Click on Choose local file and select the files or drop the files in the Drop files here part
    3. Click on Start
    4. Click on Close

  4. You can rename galaxy-pencil the dataset, sentinel_2_data.zip for example, and to keep informations about the original name SENTINEL2A.....zip

    • Click on the galaxy-pencil pencil icon for the dataset to edit its attributes
    • In the central panel, change the Name field
    • Click the Save button

Preparing data

Using preprocS2 R package, this step provides a unique tool to read, crop, resample the original image directory, and write it as a raster stack

Preprocessing sentinel 2 data

Hands-on: Preprocess
  1. Preprocessing sentinel 2 data ( Galaxy version 0.0.1) with the following parameters:
    • param-file “Input data”: sentinel_2_data.zip (Input dataset)
    • param-select “Where does your data come from ?”: ‘From Theia’
  2. Click on Execute

    Comment

    The interesting output is the ENVI image format which is a binary raster file with an accompanying header file. The data are stored as a binary stream of bytes in a BIL file without extension and the metadata are stored in the .hdr file. These data are in the output Reflectance. You can directly use the output Reflectance for the rest of the analysis.

Preprocessing outputs 3 of them : the cloud mask folder, the reflectance folder and a file with the mission source. Open image in new tab

Figure 3: Preprocessing outputs
Question
  1. What are the files you are interested in for the following tools ?
  1. The 2 files in the Reflectance folder that finish by “_Refl” and “_Refl.hdr”

Producing biodiversity indicators

You can choose to compute spectral and biodiversity indicators either for global remote sensing data or for a canopy.

Hands-on: Choose Your Own Tutorial

This is a "Choose Your Own Tutorial" section, where you can select between multiple paths. Click one of the buttons below to select how you want to follow the tutorial

Here you can choose which tutorial you want to folllow according to if your are more interested about studying canopy remote sensing data or more global ones

Compute a PCA

Hands-on: Principal components analysis for remote sensing data
  1. Compute a PCA ( Galaxy version 0.0.1) with the following parameters:
    • param-select “In which format are your data ?”: ‘The data you are using are in a zip folder Reflectance’
      • param-file “Input data”: Reflectance (output of Preprocessing sentinel 2 data tool)
    • param-select “Do you want to do a PCA or a SPCA ?”: ‘PCA’

    Check that the “Input raster” datatype is bil and that “Input raster header” datatype is hdr

    • Go on your raster data
    • Click on galaxy-pencil to edit it
    • Click on galaxy-chart-select-data Datatypes
    • On “New Type” Select bil
    • Press Save

      Comment

      Do the same for the raster header with the datatype hdr

Compute biodiversity indices

Hands-on: Biodiversity indicators for global remote sensing data
  1. Compute biodiversity indices ( Galaxy version 0.0.1) with the following parameters:
    • param-select “In which format are your data ?”: ‘The data you are using are in a zip folder Reflectance’
      • param-file “Input data”: Reflectance (output of Preprocessing sentinel 2 data tool)
    • param-text “Write a number of the value of alpha”: ‘1’

    Check that the “Input raster” datatype is bil and that “Input raster header” datatype is hdr

    • Go on your raster data
    • Click on galaxy-pencil to edit it
    • Click on galaxy-chart-select-data Datatypes
    • On “New Type” Select bil
    • Press Save

      Comment

      Do the same for the raster header with the datatype hdr

    • param-select “In which format are your data ?”: ‘Your already have the files in ENVI BIL format’
    • param-file “Input raster”: PCA raster (output of Compute a PCA tool)
    • param-file “Input header”: PCA header (output of Compute a PCA tool)
    • param-text “Write a number of the value of alpha”: ‘1’

    Here again check that the “Input raster” datatype is bil and that “Input raster header” datatype is hdr

Global biodiveristy tabular : a table summary with a column for each indicators calculated, the longitude and the latitude. Open image in new tab

Figure 4: Global biodiveristy tabular
Global biodiveristy graph : angraph example for the shannon indice shown according to the longitude and latitude. Open image in new tab

Figure 5: Global biodiveristy graph

These 2 pictures are only exemple it is normal if you don’t have exactly the same output.

Question
  1. How many biodiversity indicators do you have ?
  1. You should have 7 of them (Shannon, Renyi, Prao, Pielou, Hill, CRE, Berger-Parker). If you have only 5 of them, no problem, it just means you data are too small to compute CRE and Pielou but you can still continue your analysis.

Compute a PCA

Hands-on: Principal components analysis for remote sensing data
  1. Compute a PCA ( Galaxy version 0.0.1) with the following parameters:
    • param-select “In which format are your data ?”: ‘The data you are using are in a zip folder Reflectance’
      • param-file “Input data”: Reflectance (output of Preprocessing sentinel 2 data tool)
    • param-select “Do you want to do a PCA or a SPCA ?”: ‘PCA’

    Check that the “Input raster” datatype is bil and that “Input raster header” datatype is hdr

    • Go on your raster data
    • Click on galaxy-pencil to edit it
    • Click on galaxy-chart-select-data Datatypes
    • On “New Type” Select bil
    • Press Save

      Comment

      Do the same for the raster header with the datatype hdr

Create Biodiversity maps

Hands-on: Biodiversity indicators for canopy remote sensing data
  1. Mapping diversity ( Galaxy version 0.0.1) with the following parameters:
    • param-select “In which format are your data ?”: ‘The data you are using are in a zip folder Reflectance’
      • param-file “Input data”: Reflectance (output of Preprocessing sentinel 2 data tool)
    • param-select “Alpha, beta, functional diversity and comparison plot and map”: ‘All of the above’

    Check that the “Input raster” datatype is bil and that “Input raster header” datatype is hdr

    • Go on your raster data
    • Click on galaxy-pencil to edit it
    • Click on galaxy-chart-select-data Datatypes
    • On “New Type” Select bil
    • Press Save

      Comment

      Do the same for the raster header with the datatype hdr

A graph showing the beta diversity according to the longitude and the latitude. Open image in new tab

Figure 6: Beta diversity map
A tabular with a column for the beta diversity, the longitude and the latitude. Open image in new tab

Figure 7: Beta diversity tabular

Processing remote sensing data

Hands-on: Comparing biodiversity indicators for canopy
  1. Comparing remote sensing data ( Galaxy version 0.0.1) with the following parameters:
    • param-select “In which format are your data ?”: ‘The data you are using are in a zip folder Reflectance’
      • param-file “Input data”: Reflectance (output of Preprocessing sentinel 2 data tool)
    • param-file “Plots folder zip”: output (Input dataset)
    Comment: Shapefiles

    Here you must provide your folder of shapefiles (at least 2 in order to have the beta diversity).

    Comment: Check datatype if you use your own ENVI BIL files

    Same as the compute spectral indices make sure you have the right datatypes bil and hdr.

Biodiversity comparison graph allowing to locate the different types of vegetation in the PCoA space. Open image in new tab

Figure 8: Biodiversity comparison graph
Bray curtis table for the types of vegetation. Open image in new tab

Figure 9: Bray curtis table
Question
  1. What kind of data do you need to use these tools ?
  2. Do you need a shapefile for mapping the diversity ?
  3. Why do you need multiple locations for comparing biodiversity ?
  1. This analisys is for data on forest, it’s a canopy study.
  2. No, only for the comparison with in situ data.
  3. The Bray curtis table compare the diversity between locations.

Spectral indices

Hands-on: Compute spectral indices
  1. Compute spectral indices ( Galaxy version 0.0.1) with the following parameters:
    • param-select “In which format are your data ?”: ‘The data you are using are in a zip folder Reflectance’
      • param-file “Input data”: Reflectance (output of Preprocessing sentinel 2 data tool)
    • param-select “Input the type of indice you want”: ‘NDVI’

    • param-select “Do you want the raster layer of the indice as an output ?”: ‘No’

    Check that the “Input raster” datatype is bil and that “Input raster header” datatype is hdr

    • Go on your raster data
    • Click on galaxy-pencil to edit it
    • Click on galaxy-chart-select-data Datatypes
    • On “New Type” Select bil
    • Press Save

      Comment

      Do the same for the raster header with the datatype hdr

    Comment

    You can choose whichever indice you want

A tabular with columns for the NDVI index, the longitude and the latitude. Open image in new tab

Figure 10: Normalized different vegetation index

Remotely sensed diversity is consistent with most of the essential spatially constrained biodiversity variables proposed by Skidmore et al. (2015). This highlights the need for increased dialogue and collaboration between the biodiversity monitoring community and the remote sensing community to make satellite remote sensing a tool of choice for conservation. Increased dialogue is also essential within the biodiversity monitoring community to achieve this. From this point of view multiple Satellite Remote Sensing EBV (SRS EBV) were created. Some of the indices proposed here will allow you to compute SRS EBV. For instance it allows you to compute one of GEO BON EBV Canopy Chlorophyll Content. This EBV is computed by GEO BON on the Netherlands, here you can compute it on which ever Sentinel 2 data you want by chosing to calculate the indice CCCI.

A tabular showing the Canopy Chlorophyl Content index according to the longitude and latitude. Open image in new tab

Figure 11: Canopy Chlorophyl Content index tabular
Question
  1. What’s the difference between biodiversity indicators and spectral indices ?
  1. Biodiversity indicators give us informations on the heterogeneity of the landscape whereas spectral indices inform us on the well being of the vegetation.

Conclusion

You are now all set to use your remote sensing data in order to do a biodiversity analysis. Before you go on one last reflexion.

Question
  1. Should remote sensing replace in-situ data ?
  1. NO ! remote sensing and in-situ data should come and complete one another to have the most complete view of the state of biodiversity.