Universität Bonn

Center for Remote Sensing of Land Surfaces (ZFL)

Using Optical Data to Map Floods

Flood Module
This document explains how to use Copernicus’s SNAP software to map floods using locally downloaded Sentinel-2 data on your own machine.

Overview
Optical sensors operating in the VIS, NIR and SWIR spectrum on board of several satellites have been launched into space and are constantly capturing images of the Earth’s surface. Examples of active optical sensors in space include Rapid Eye, MODIS and Sentinel-2.

The Copernicus Sentinel-2 mission comprises a constellation of two satellite placed on the same sun-synchronous orbit phased at 180 degrees to each other, guaranteeing a wide swath width (290km) and a revisit time of 10 days at the equator with one satellite and 5 days with 2 satellites in cloud free conditions resulting in 2-3 days in mid-latitudes.

Flood mapping from satellite imagery is a semantic segmentation process which is a well-studied problem with several studies applying this technique [1]–[3]. The main concept behind flood mapping is to exploit the difference in absorption of light between the green and near infrared bands by water and non-water covers [4].  In this guide, a thresholding and binary classification approach is explained step by step in ESA’s Sentinel Application Platform (SNAP) software and QGIS.

Image acquisition
Sentinel 2 data are freely available through various portals such as the ESA Hub. For a detailed step by step guide on how to download the Sentinel-2 scenes, follow the steps described in the general module (video coming soon).

Using SNAP
The product is first loaded into SNAP by navigating to File -> Open Product and navigating to the downloaded Sentinel 2 product folder. Once opened, the bands and the accompanying metadata can be viewed in the product explorer panel. A specific band can be viewed on the viewer by simply clicking on it.

Figure 1 Sentinel 2 Image opened in SNAP.gif
© Figure 1: Sentinel 2 Image opened in SNAP

Image Subset
SNAP software presents three different types of sub-setting methods: spatial subset, band subset and meta-data subset. For this guide, the spatial and band subsets are used. The spatial subset clips the image to the extents of the bounding box of the area of interest while the band subset selects only the bands that are needed for the intended application. In both cases, the goal is to reduce the size of the data and subsequently reduce the processing time. The subset tools can be accessed by Raster -> Subset

Figure 2 Subsetting in SNAP spatial extents subset(left) and band subset(right).gif
© Figure 2: Subsetting in SNAP; spatial extents subset(left) and band subset(right)

NDWI Calculation
The Normalized Difference Water Index (NDWI) is used to highlight water surfaces in a satellite imagery separating them from other land covers such as vegetation and soil. NDWI is computed from the visible green (Sentinel-2 Band 3) and near infrared bands (Sentinel-2 Band 8). The visible green maximizes the typical reflectance of the water surfaces while the near infrared maximizes the high reflectance of vegetation and soil surfaces while minimizing the low reflectance of water surfaces. This results in positive values for water features and negative values for terrestrial vegetation and soil surfaces.

NDWI.gif
© .

To compute the NDWI in SNAP, go to Raster menu -> Band math and in the band math editor enter the formula shown in the equation above.

Figure 3 NDWI calculation using Band Math Calculator.gif
© Figure 3: NDWI calculation using Band Math Calculator

Alternatively, SNAP has an inbuilt function that computes NDWI and other water related indices. This can be accessed via Optical -> Thematic Land Processing -> Water Radiometric Indices -> NDWI processor. Under the I/O parameters tab, the input and output directories are specified and the bands to be used are specified under the processing parameters tab.

Figure 4 Using inbuilt function to compute NDWI.gif
© Figure 4: Using inbuilt function to compute NDWI

Binarization
To distinguish between flood and non-flood pixels, the image will need to be binarized, that is assigning the pixels a value of either 0 or 1. A threshold corresponding to water pixels will need to be determined. In general a global NDWI threshold exists for water pixels based in Sentinel 2, however, due to the dynamic nature of different water surfaces, it is important to develop a local threshold specific for water cover at the specific time. A common approach that is also applied in this guide is sampling and averaging. This approach involves finding the average of NDWI values of pixels that are visually identified to be covered by water. A true color composite can be used to aid in visual identification on water pixels.

Figure 5 Sampling pixel values using pixel_info tab.gif
© Figure 5: Sampling pixel values using pixel_info tab

Another way of finding a water threshold is using a distribution histogram. The distribution of pixel values can be used to separate the majority land cover and the minority land cover. In most instances, the minority will be water pixels with exception of image scenes captured around water bodies. The distribution histogram can be viewed in SNAP under color manipulation. The peak on the histogram that represents water pixels can be identified and the visualization of values of the minimum and maximum can be adjusted accordingly using the slider along the X-axis as illustrated by Figure 6.

Figure 6 Pixel value distribution histogram The highlighted peak represents water pixels.gif
© Figure 6: Pixel value distribution histogram. The highlighted peak represents water pixels

Once the threshold for water is determined, the next step is assigning pixels that are above the threshold a specific  value (1) from those that are below the threshold (0). This can be done in the band math calculator as shown in Figure 7.

Figure 7 Binarization using Band Math calculator.gif
© Figure 7: Binarization using Band Math calculator

Visualization
For clearer visualization and further analysis of the flood maps, SNAP provides the possibility to export the processed image as Geotiff which can then be loaded in GIS software e. g. QGIS.

Figure 8 Visualization of the binarized NDWI.gif
© Figure 8: Visualization of the binarized NDWI

The binarized image can be exported as Geotiff or KMZ and visualized and processed further in a GIS environment e.g Qgis or Arcgis.

Using QGIS
Sentinel 2 data can also be processed using QGIS with the help of third party plugins. The commonly used plugin for Sentinel-2 optical data processing is the Semi-Automatic classifier plugin. To install a new plugin in QGIS, go to Plugins -> Manage/Install Plugins and search for the name of the plugin. Once installed a new tab “SCP” will appear on the main menu on top.

The first step in processing of sentinel-s imagery in QGIS is loading the downloaded Sentinel 2 scenes. The required bands can be chosen to limit the amount of data to be processed and, consequently, the processing time. Since Band 3 and Band 8 are required in this situation, they can be chosen as shown in Figure 9.  A sentinel-2 product folder download is composed of several sub-folders, to locate the imagery navigate to GRANULE -> L1C_... -> IMG_DATA and select the required bands.

Figure 9 Band selection in QGIS browser.gif
© Figure 9: Band selection in QGIS browser

Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen. Klicken Sie hier, um Text hinzuzufügen.

Figure 10 Setting appropriate coordinate reference system (CRS).gif
© Figure 10: Setting appropriate coordinate reference system (CRS)

If the downloaded image is L1C, the image will have to be corrected for atmospheric effects. This is called Top of Atmospheric correction and can be done in QGIS using the Semi-Automatic Classifier (SCP) plugin.

To perform Top of Atmospheric correction go to SCP -> Pre-processing -> Sentinel-2. Under the “Directory containing Sentinel-2” tab, navigate to the IMG_DATA folder that contains the different spectral bands. Under the“Select metadata file(MTD_MSI)” navigate to the folder name MTD_L1.xml.The top-of atmosphere corrected bands will be added as layers in QGIS with the prefix “TL”

Figure 11 Top of Atmospheric correction for Sentinel-2 L1C product.gif
© Figure 11: Top of Atmospheric correction for Sentinel-2 L1C product

The next step will involve computing the Normalized Difference Water Index (NDWI) which is the basis of separating water pixels from the other land cover types. The NDWI can be computed from the formula (NDWI Calculation). The formula can be keyed in either in the raster calculator or the band calculator provided by the Semi-Automatic classifier.

Figure 12 Computing NDWI using the band calc in Semi-Automatic classifier.gif
© Figure 12: Computing NDWI using the band calc in Semi-Automatic classifier

To separate the water pixels from the non-water pixels, a separating threshold will have to be identified from the computed NDWI. This can be done by finding the average index value for areas that can be visually identified as flooded. In this case, several sample points containing water pixels are taken and their average is computed.

Figure 13 Computing NDWI in raster calculator.gif
© Figure 13: Computing NDWI in raster calculator

Using the identify tool, sample NDWI values of pixels that can be identified to be certainly covered by water can be derived. An average of at least 4 sample pixels would be sufficient.

Figure 14 Sampling pixel values using the identify tool.gif
© Figure 14: Sampling pixel values using the identify tool

Alternatively, a distribution histogram of the NDWI values can be computed by right clicking on the NDWI layer -> Properties -> Histogram. Since majority of the area is not covered by water (with exception of scenes around water bodies) the distribution histogram will have two peaks, where the larger peak will represent non-water pixels while the smaller peak represents water pixels. The threshold can then be determined by taking the values of the left and right ends of the peak, this way, all water pixels are captured. The specific values can be derived by zooming into the peak by clicking and dragging the mouse pointer around the peak.

Figure 15 Raster values histogram and a zoom in to the peak representing water.gif
© Figure 15: Raster values histogram and a zoom in to the peak representing water

The identified threshold can then be used to binarize the raster, that is assigning a value of 1 to water pixels and a value of 0 to non-water pixels. This can be done using the raster calculator as shown in figure below.

The binarized layer will have values of 1 for pixels covered by water and 0 for non-water pixels as shown below. To clearly delineate the flooded area, it may be necessary to subtract the permanent water surfaces.

Figure 16 Binarizing in QGIS raster calculator.gif
© Figure 16: Binarizing in QGIS raster calculator

The impact of the floods on the various social infrastructures can then be quantified as described in the impact assessment section.

Figure 17 Visualization of binarized NDWI.gif
© Figure 17: Visualization of binarized NDWI

References

[1]  G. A. Kordelas, I. Manakos, G. Lefebvre, and B. Poulin, “Automatic Inundation Mapping Using Sentinel-2 Data Applicable to Both Camargue and Doñana Biosphere Reserves,” Remote Sens., vol. 11, no. 19, Art. no. 19, Jan. 2019, doi: 10.3390/rs11192251.

[2]  M. C. R. Cordeiro, J.-M. Martinez, and S. Peña-Luque, “Automatic water detection from multidimensional hierarchical clustering for Sentinel-2 images and a comparison with Level 2A processors,” Remote Sens. Environ., vol. 253, p. 112209, Feb. 2021, doi: 10.1016/j.rse.2020.112209.

[3]  X. Yang et al., “Monthly estimation of the surface water extent in France at a 10-m resolution using Sentinel-2 data,” Remote Sens. Environ., vol. 244, p. 111803, Jul. 2020, doi: 10.1016/j.rse.2020.111803.

[4]  A. Goffi, D. Stroppiana, P. A. Brivio, G. Bordogna, and M. Boschetti, “Towards an automated approach to map flooded areas from Sentinel-2 MSI data and soft integration of water spectral features,” Int. J. Appl. Earth Obs. Geoinformation, vol. 84, p. 101951, Feb. 2020, doi: 10.1016/j.jag.2019.101951.

Wird geladen