Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Flood Mapping With Sentinel-1 Script

//VERSION=3 (auto-converted from 1)
// Date Definition 
var beforeflood_date = "2019-03-11"; var duringflood_date = "2019-03-23"; // Flood in Aghghala, Iran     
//var beforeflood_date = "2019-01-06"; var duringflood_date = "2019-01-14"; // Flood in Uruguaiana, Rio Grande do Sul, Brazil       
//var beforeflood_date = "2020-01-04"; var duringflood_date = "2020-01-13"; // Flood in southern Iran
 
// Selection of polarization 
function setup() {
  return {
    input: [{
      bands: [
        "VV"
      ]
    }],
    output: { bands: 3 },
    mosaicking: "ORBIT"
  }
}

function preProcessScenes (collections) {
  var allowedDates = [beforeflood_date,duringflood_date]; // set dates for before-and-during flood analysis
  collections.scenes.orbits = collections.scenes.orbits.filter(function (orbit) {
      var orbitDateFrom = orbit.dateFrom.split("T")[0];
      return allowedDates.includes(orbitDateFrom);
  })
  return collections
}

// Flood mapping
function calcFM(sample) {
  var outvv = sample.VV;
  return [1.5*outvv];
}

function dateformat(d){  
  var dd = d.getDate();
  var mm = d.getMonth()+1;
  var yyyy = d.getFullYear();
  if(dd<10){dd='0'+dd}
  if(mm<10){mm='0'+mm}
  var isodate = yyyy+'-'+mm+'-'+dd;
  return isodate;
}

function evaluatePixel(samples,scenes) {  
  var outbe = 0;
  var outdu = 0;  
  // before-flood image
  outbe = calcFM(samples[1]);
  // during-flood image
  outdu = calcFM(samples[0]);  
  return [outbe,outdu,outdu]
 // ************************************
 // mask creation
 // var dout = outbe - outdu;    
 // return [dout > 0.05 ?  1 : 0]
 // ************************************
}

Evaluate and visualize

Example 1

Example 2

Example 3

Example 4

Example 5

General description of the script

Floods are one of the most destructive natural hazard worldwide that causes severe economic, environmental, and human losses. I have developed a script to describe the capabilities of the Sentinel-1 radar images for flood mapping in three case study areas (Aghghala, Iran; Kalani, Iran; Uruguaiana, Rio Grande do Sul, Brazil). The script is adapted to Sentinel-1 IW GRD images with VV polarization and helps in visualization of flooded areas. The visualization allows to quickly determine the extent of the damaged areas regardless of weather conditions. Also it can be helpful to recognize the flood patterns. The algorithm works great for separating flooded areas from permanent water bodies and land areas. It must be used only in multi-temporal processing with two images before and during the flood.

Details of the script

For Providing the outputs, the \([1.5*VV_{before flood}, 1.5*VV_{during flood}, 1.5*VV_{during flood}]\) combination is used for [R, G, B]. This combination allows to discriminate between flooded areas and permanent water bodies, land, unflooded areas. The permanent water bodies are shown as black due to the specular reflection and so darkness of all three channels. The flooded areas are often displayed in red, due to the darkness of green and blue channels and the brightness of red channel. However, the flooded urban areas do not appear dark. This is because, in these regions, there are multiple scatterers, such as buildings, that send parts of the signal back towards the radar. Also, the presence of water at the base of the vegetation, buildings, and unflooded areas results in a double-bounce scattering. These can be identified through their high response at VV and different colours (e.g. cyan) in the RGB image. To separate flooded from unflooded a threshold is selected on the difference values between the before and during flood backscatters. In outputs, low values correspond to the less affected areas (black colour), and high values correspond to the more affected areas (red colour).

Note that mixing ascending and descending orbit directions causes difference in noise patterns, making results difficult to compare. The compared images should both have matching orbit directions, when possible.

Author of the script

Maryam Salehi

Description of representative images

1) First case study: Flood mapping in Aghghala, Iran using an image during the flood on 2019/03/23 and a reference image before the flood from 2019/03/11. R=2019/03/11,B,G=2019/03/23.

The script example 1

2) Second case study: Flood mapping in Kalani, Iran using an image during the flood on 2020/01/13 and a reference image before the flood from 2020/01/04. R=2020/01/04,B,G=2020/01/13.

The script example 2

3) Third case study: Flood mapping in Uruguaiana, Rio Grande do Sul, Brazil using an image during the flood on 2019/01/14 and a reference image before the flood from 2019/01/06. R=2019/01/06,B,G=2019/01/14.

The script example 3

4) The outputs of applying thresholds of 0.05 for the first case study.

The script example 4

5) The outputs of applying thresholds of 0.08 for the first case study.

The script example 5