0% found this document useful (0 votes)
69 views17 pages

Guide To Flood Inundation Mapping Using Sentinel-1A in GEE

This document is helpful to practice in mapping flood using Google Earth Engine

Uploaded by

amritpal digra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views17 pages

Guide To Flood Inundation Mapping Using Sentinel-1A in GEE

This document is helpful to practice in mapping flood using Google Earth Engine

Uploaded by

amritpal digra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

A Complete Guide to Flood Inundation Mapping with Sentinel-1A SAR Data in

Google Earth Engine


(A Step-by-Step Tutorial)

Flood inundation mapping is the process of identifying and visualizing areas that are, or could be,
covered by floodwaters during a flood event. It provides a spatial representation of flood-prone regions,
which is crucial for disaster management, risk assessment, and emergency response planning.

Satellite-based flood assessment for determining the extent and severity of a flood is a vital resource
before, during, and after the event, especially for environmental and socio-economic assessments.
Although optical remote sensing data has been widely used for flood hazard mapping, cloud-free optical
images are hard to obtain during the rainy season. In this scenario, SAR (Synthetic Aperture Radar)
data is well-suited for detecting inundated areas and acquiring reliable information during a flood event
because it can operate in all weather conditions, both day and night. As the Synthetic Aperture Radar
operates in the Microwave region of the Electromagnetic spectrum, it has the advantages of penetrating
through dense vegetation and cloud cover which makes it capable of detecting inundation under
vegetated areas.

Before going into the detailed steps, let’s explore the SAR Sensors and their Key Specifications
Table I: SAR Sensors and their Key Specifications

SENSOR & LIFETIME WAVELENGTH POLARIZATION RESOLUTION FRAME SIZE REPEAT


DEVELOPED /FREQUENCY CYCLE
BY
Seasat 1978 L-band HH Az: 25m 100km -
(NASA) λ = 24.6cm Rg: 25m

ERS-1 1991-2001 C-band VV Az: 6-30m 100km 35 days


(ESA) λ = 05.6cm Rg: 26m
JERS-1 1995-1998 L-band HH Az: 18m 75km 44 days
(JAXA) λ = 24.6cm Rg: 18m
ERS-2 1995-2011 C-band VV Az: 6-30m 100km 35 days
(ESA) λ = 05.6cm Rg: 26m
ENVISAT 2002-2012 C-band HH, VV, VV/HH, Az: 28m 100km 35 days
(ESA) λ = 05.6cm HH/HV, VV/VH Rg: 28m

ALOS-1 2006-2011 L-band FBS: HH, VV FBS: 10x10m FBS: 70km 46 days
(JAXA) λ = 24.6cm FBD: HH/HV, FBD: 20x10m FBD: 70km
HH/VH PLR: 30x10m PLR: 30km
PLR: ScanSAR: 100m ScanSAR: 250-
HH/HV/VH/VV 350km
ScanSAR: HH,
VV
Radarsat-1 1995-2013 C-band HH Standard: Standard: 100km 24 days
(CSA) λ = 05.6cm 25x28m Fine: 45km
Fine: 9x9m Wide1: 165km
Wide1: 35x28m Wide2: 150km
Wide2: 35x28m ScanSAR: 305-
ScanSAR: 50x50- 510km
100x100m

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
TerraSAR-X 2007- X-band Single: HH, VV Spotlight: Spotlight: 3- 11 days
TanDEM-X 2010- λ = 03.5cm Dual: HH/VV, 0.2x1.0-1.7x3.5m 10km
(DLR) HH/HV, VV/VH Stripmap: 3x3m Stripmap:
Twin: HH/VV, ScanSAR: 18- 50x30km
HH/VH, VV/VH 40m ScanSAR:
150x100-
200x200km
Radarsat-2 2007- C-band Single: HH, VV, Spotlight: ~1.5m Spotlight: 24 days
(CSA) λ = 05.6cm HV, VH Stripmap: ~3x3- 18x8km
Dual: HH/HV, 25x25m Stripmap: 20-
VV/VH ScanSAR: 35x35- 170m
Quad: 100x100m ScanSAR:
HH/HV/VH/VV 300x300-
500x500km
COSMO- 2007- X-band Single: HH, VV, Spotlight: ≤1m Spotlight: Satellite:
SkyMed λ = 03.5cm HV, VH Stripmap: 3-15m 10x10km 16 days
(ASI) Dual: HH/HV, ScanSAR: 30- Stripmap: Constellati
HH/VV, VV/VH 100m 40x40km on: ~hrs
ScanSAR:
100x100-
200x200km
ALOS-2 2014- L-band Single: HH, VV, Spotlight: 1x3m Spotlight: 14 days
PALSAR-2 λ = 24.6cm HV, VH Stripmap: 3-10m 25x25km
(JAXA) Dual: HH/HV, ScanSAR: 25- Stripmap:
VV/VH 100m 55x70-70x70km
Quad: ScanSAR:
HH/HV/VH/VV 355x355km
Sentinel-1 2014- C-band Single: HH, VV Stripmap: 5x5m Stripmap: Satellite:
(ESA) λ = 05.6cm Dual: HH/HV, IW: 5x20m 375km 12 days
VV/VH EW: 20-40m IW: 250km Constellati
EW: 400km on: 6 days
SAOCOM 2018- L-band Single: HH, VV Stripmap: Stripmap: Satellite:
(CONAE) λ = 24.6cm Dual: HH/HV, 10x10m >65km 16 days
VV/VH TopSAR: TopSAR: 320km Constellati
Quad: 100x100m on: 8 days
HH/HV/VH/VV
PAZ SAR 2018- X-band *See *See *See 11 days
(Spain's λ = 03.5cm TerraSAR/TanD TerraSAR/TanDE TerraSAR/TanDE
Ministry of EM-x M-x M-x
Defense and
INTA)
RCM 2019 C-band λ = Single: HH, VV, Very high, high, 20x20- Satellite:
(CSA) 05.6cm VH, HV Dual: medium, and 500x500km 12 days
HH/HV, VV/VH, low-res modes Constellati
HH/VV (3-100m) on: ~hrs
Compact Quad
**Note: The abbreviations of the short forms are written at the end of the article

SOURCE: Meyer, Franz. “Spaceborne Synthetic Aperture Radar – Principles, Data Access, and Basic Processing
Techniques.” SAR Handbook: Comprehensive Methodologies for Forest Monitoring and Biomass Estimation. Eds.
Flores, A., Herndon, K., Thapa, R., Cherrington, E. NASA.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
Now let’s dive into the process of Flood Inundation Mapping using SAR data:
Dataset Used in the Process
I've used Sentinel-1A data for flood inundation mapping because its high-resolution SAR imagery can capture
detailed surface changes even in cloudy and rainy conditions, which are common during floods. Sentinel-1A's C-
band radar is particularly effective for detecting water bodies, making it ideal for accurately mapping flood extent.
Additionally, its frequent revisit time allows for timely monitoring, which is crucial in assessing and managing
flood events over large areas.

Steps Followed in Google Earth Engine


Let’s understand the procedure of Flood Inundation Mapping in Google Earth Engine in detail.
Follow the steps explained below for the process:
1. For the flood mapping , first we have to select an Area of Interest (AOI) where we want to run the
analysis. Several processes are there of selecting an area in google earth engine. We can upload
a shape files or CSV file for denoting our AOI or we can simply draw a polygon over a region.
Here, I’ve uploaded Shape file of the state Assam. Following are the steps, can be followed for
uploading a Shape file.
In the left section of the Google earth engine Interface click on ‘Asset’ > Add A Project >
Select all the extensions of the shape files > Give an asset name >Upload.

In right side, in the task section we can see if the shapefile has successfully uploaded or not.
2. After successful uploading of the file, we can see the file in the asset section.
Now select the file > Import into script.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
3. Here, my study area is the Marigaon district in Assam. However, I uploaded a shapefile containing
the entire state of Assam. To focus on Marigaon for my analysis, I needed to filter the shapefile to
extract only the data for this district. Below is the code for filtering the study area, followed by
an explanation of each step.
But first, before writing the code, change the name of the ‘var table’ to your ‘Asset’ name:

Change the variable name to your asset name

Code:

var dt = Assam.filter(ee.Filter.eq('Name', 'MARIGAON'));


Map.addLayer(dt);
Map.centerObject(dt);

Explanation:
var dt = Assam.filter(ee.Filter.eq('Name', 'MARIGAON'));
• var dt: This declares a new variable named dt to store the result of the operation.
• Assam: dataset related to the state of Assam in India.
• .filter(ee.Filter.eq('Name', 'MARIGAON')): This applies a filter to the Assam collection.
o ee.Filter.eq('Name', 'MARIGAON'): This filter checks for features within the Assam collection
where the attribute Name is equal to 'MARIGAON'. As a result, dt will contain only the features
that match this criterion (i.e., features representing the location named Marigaon).
• Map.addLayer(dt); This line adds the filtered collection dt to the GEE map. The map will visualize the
features that correspond to Marigaon based on the filtering applied in the previous line.
• Map.centerObject(dt); This line centers the map view on the features contained in the variable dt. It
adjusts the map's view to focus on the geographical area of Marigaon, allowing for better visualization of
the relevant data.
At this point if we run the code, we can see the boundary of Marigaon on the map.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
4. The next step is to import the Sentinel-1A data. For this we have to write sentinel 1 in the seach
bar and we will get all the datasets related to it. Here I’ve chosen the “Sentinel 1A SAR GRD” for
my analysis.
After selecting the data, we have to copy the image collection snippet and paste it in our code.

Also, the other image properties we have to copy from the ‘image properties’ section of the dataset.

Code:

var collection = ee.ImageCollection('COPERNICUS/S1_GRD')


.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filter(ee.Filter.or(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'),
ee.Filter.eq('orbitProperties_pass', 'ASCENDING')));

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
Explanation:
• var collection: Declares a variable collection to store the Sentinel-1 image data.
o ee.ImageCollection('COPERNICUS/S1_GRD'): Initializes an ImageCollection containing Sentinel-1
Ground Range Detected (GRD) images
• filter(): Filters the image collection.
o ee.Filter.listContains: Checks if the image polarization list includes 'VH' (Vertical transmit and
Horizontal receive), often used for vegetation monitoring or water mapping..
o ee.Filter.eq: Ensures only images from the 'IW' (Interferometric Wide) mode are included, which are
suitable for wide-area mapping.
o ee.Filter.or: Combines conditions to include images from either descending or ascending orbits.
▪ ee.Filter.eq('orbitProperties_pass', 'DESCENDING'): Filters for images captured during
descending orbits.
▪ ee.Filter.eq('orbitProperties_pass', 'ASCENDING'): Filters for images captured during
ascending orbits.
This filtering is essential for applications that require data from both orbit passes, ensuring a comprehensive
dataset.
5. Now we need to define variable containing pre flood and post flood images.
Code:

//Filtering for Before and After Flood images and Creating mosaic
var before = collection.filter(ee.Filter.date('2016-03-01', '2016-04-10')).filterBounds(dt);
var after = collection.filter(ee.Filter.date('2016-06-15', '2016-08-06')).filterBounds(dt);

print(before);
print(after);

var before_image = before.select('VH').mosaic().clip(dt);


var after_image = after.select('VH').mosaic().clip(dt);

Explanation:
• var before: Declares a variable before to store images taken before the flood.
o collection.filter(ee.Filter.date('2016-03-01', '2016-04-10')): Filters the image collection for
images captured between March 1, 2016, and April 10, 2016.
o filterBounds(dt): Further filters the images to only those that intersect with the region defined
by dt
• var after: Declares a variable after to store images taken after the flood.
o collection.filter(ee.Filter.date('2016-06-15', '2016-08-06')): Filters the image collection for
images captured between June 15, 2016, and August 6, 2016.
• print(before): Outputs the before image collection to the console for review.
• print(after): Outputs the after image collection to the console for review
• var before_image = before.select('VH').mosaic().clip(dt); creates a single image called before_image
mosaicking all selected images into one and clipping it to the region defined by dt
• var after_image = after.select('VH').mosaic().clip(dt); creates a single image called after_image
mosaicking all selected images into one and clipping it to the region defined by dt

6. The next step is to apply filter on the images. Here I’ve applied a median filter on the images.
Applying a median filter to Sentinel-1A images is essential for reducing speckle noise while
preserving edges and fine structures. This noise reduction enhances the overall image quality,
facilitating better visual interpretation and feature extraction, making it a valuable
preprocessing step before conducting advanced analysis.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
Code:

var before_filtered = before_image.focal_median(30, "circle", "meters");


var after_filtered = after_image.focal_median(30, "circle", "meters");

Explanation:
• var before_filtered = before_image.focal_median(30, "circle", "meters"); :Applies a focal median
filter to before_image, using a circular neighborhood with a radius of 30 meters to smooth the
image and reduce noise, storing the result in before_filtered.
• var after_filtered = after_image.focal_median(30, "circle", "meters"); : Applies a focal median filter to
after_image, using a circular neighborhood with a radius of 30 meters to smooth the image and reduce
noise, storing the result in after_filtered.

7. Now we need to mask out the flood inundation layer and layer and the layer with actual
waterbodies.
Code:

//Masking out Flood Inundation and Water submerged layer


var flood = before_filtered.gt(-20).and(after_filtered.lt(-20));
var flood_mask = flood.updateMask(flood.eq(1));

var water = before_filtered.lt(-20).and(after_filtered.lt(-20));


var water_mask = water.updateMask(water.eq(1));

Explanation:
• var flood = before_filtered.gt(-20).and(after_filtered.lt(-20));: Creates a mask called flood by
checking where before_filtered is greater than -20 and after_filtered is less than -20, indicating
areas of flood inundation.
• var flood_mask = flood.updateMask(flood.eq(1)); : Updates the flood mask to create
flood_mask, which retains only the areas where the flood condition is true (equal to 1).
• var water = before_filtered.lt(-20).and(after_filtered.lt(-20)); : Creates a mask called water
by checking where both before_filtered and after_filtered are less than -20, indicating areas
covered by water
• var water_mask = water.updateMask(water.eq(1)); : Updates the water mask to create
water_mask, which keeps only the areas where the water condition is true (equal to 1).

8. At this point we will add all the layers to the map we have created till now.
Code:

//Adding layer
Map.addLayer(before_filtered,{min:-25,max:0},'before_filtered')
Map.addLayer(after_filtered,{min:-25,max:0},'after_filtered')
Map.addLayer(flood_mask,{palette:['Yellow']},'Flood_Inundation')
Map.addLayer(water_mask,{palette:['Blue']},'Water')

Explanation:
• Map.addLayer(before_filtered,{min:-25,max:0},'before_filtered') : Adds the before_filtered image to
the map with a color range from -25 to 0, labeling it as 'before_filtered'.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
• Map.addLayer(after_filtered,{min:-25,max:0},'after_filtered') : Adds the after_filtered image to the
map with a color range from -25 to 0, labeling it as 'after_filtered'.
• Map.addLayer(flood_mask,{palette:['Yellow']},'Flood_Inundation') : Adds the flood_mask to the map
using yellow color to represent areas of flood inundation, labeling it as 'Flood_Inundation'.
• Map.addLayer(water_mask,{palette:['Blue']},'Water') : Adds the water_mask to the map using blue
color to represent water-covered areas, labeling it as 'Water'.

If we run the code at this point, we can see all the four layers in the map.

Before Flood Image After Flood Image

Flood Inundated Areas


Flood Inundated Areas and Waterbodies

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
9. We’ll calculate the area of the layers.
Code:

// Area Calculations
var district_area = ee.Image.pixelArea().clip(dt);
var total_district_area = district_area.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: dt.geometry(),
scale: 30,
maxPixels: 1e9
}).get('area');
var total_district_area_km2 = ee.Number(total_district_area).divide(1e6);
print('Total District Area (sq.km):', total_district_area_km2);

var flood_area = ee.Image.pixelArea().updateMask(flood_mask).clip(dt);


var total_flood_area = flood_area.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: dt.geometry(),
scale: 30,
maxPixels: 1e9
}).get('area');
var total_flood_area_km2 = ee.Number(total_flood_area).divide(1e6);
print('Flood Inundated Area (sq.km):', total_flood_area_km2);

var water_area = ee.Image.pixelArea().updateMask(water_mask).clip(dt);


var total_water_area = water_area.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: dt.geometry(),
scale: 30,
maxPixels: 1e9
}).get('area');
var total_water_area_km2 = ee.Number(total_water_area).divide(1e6);
print('Waterbody Area (sq.km):', total_water_area_km2);

Explanation:

• var district_area = ee.Image.pixelArea().clip(dt); : Creates an image representing the area of each pixel
(in square meters), clipped to the specified district geometry (dt).
• var total_district_area = district_area.reduceRegion({ : Initiates the process to compute the total area
of the district.
• reducer: ee.Reducer.sum(), : Indicates that the sum of the pixel areas will be calculated.
• geometry: dt.geometry(), :Specifies that the area calculation will be based on the geometry of the
district (dt).
• scale: 30, :Sets the spatial resolution for the calculations to 30 meters.
• maxPixels: 1e9 :Sets the maximum number of pixels that can be processed in the operation.
• }).get('area'); : Retrieves the calculated total area (in square meters) from the result.
• var total_district_area_km2 = ee.Number(total_district_area).divide(1e6); : Converts the total area
from square meters to square kilometers by dividing by 1,000,000.
• print('Total District Area (sq.km):', total_district_area_km2); Outputs the total district area in square
kilometers to the console.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
• var flood_area = ee.Image.pixelArea().updateMask(flood_mask).clip(dt); :Computes an area image
for pixels masked by flood_mask (indicating flooded areas) and clipped to the district geometry.
• var total_flood_area = flood_area.reduceRegion({ :Begins the calculation for the total flooded area.
• print('Flood Inundated Area (sq.km):', total_flood_area_km2); : Outputs the total flood inundated
area in square kilometers.
• var water_area = ee.Image.pixelArea().updateMask(water_mask).clip(dt); Creates an area image
for pixels masked by water_mask (indicating water bodies) and clipped to the district geometry.
• var total_water_area = water_area.reduceRegion({ : Starts the calculation for the total area of water
bodies.
• var total_water_area_km2 = ee.Number(total_water_area).divide(1e6); : Converts the total water
area from square meters to square kilometers.
• print('Waterbody Area (sq.km):', total_water_area_km2); Outputs the total area of water bodies in
square kilometers.
At this point if we run the entire code, we will be able to see the calculated area in the console section.

10. Now we can also add Map title, Map legend in the map.
Code:

//Map Layout

// Set position of panel


var legend = ui.Panel({
style: {
position: 'bottom-left',
padding: '8px 15px'
}
});

Explanation:

• var legend = ui.Panel({ : Creates a user interface (UI) panel called legend, which will hold
o style: { position: 'bottom-left', padding: '8px 15px' }: Specifies the style for the panel:
▪ position: 'bottom-left': Places the panel at the bottom-left corner of the map.
▪ padding: '8px 15px': Adds padding around the panel content, 8 pixels vertically and 15
pixels horizontally.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
Code:

// Create legend title


var legendTitle = ui.Label({
value: 'Legend',
style: {
fontWeight: 'bold',
fontSize: '20px',
margin: '0 0 4px 0',
padding: '0'
}
});

// Add the title to the panel


legend.add(legendTitle);

// Creates and styles 1 row of the legend.


var makeRow = function(color, name) {
var colorBox = ui.Label({
style: {
backgroundColor: color,
padding: '14px',
margin: '0 0 4px 0'
}
});

var description = ui.Label({


value: name,
style: {margin: '0 0 4px 6px'}
});

return ui.Panel({
widgets: [colorBox, description],
layout: ui.Panel.Layout.Flow('horizontal')
});
};

// Palette with the colors


var palette = ['Yellow', 'Blue'];

// Names of the legend


var names = ['Flood Inundation', 'Water body'];

// Add color and names


for (var i = 0; i < 2; i++) {
legend.add(makeRow(palette[i], names[i]));
}

// Add legend to map


Map.add(legend);

// Set position of title panel


var title = ui.Panel({
style: {
position: 'top-center',
padding: '8px 15px'
Sukanya Mandal
}
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
});
Explanation:
• var legendTitle = ui.Label({...}); : Creates a UI label called legendTitle with the text "Legend," styled to
be bold, 18px in size, and with some margin and padding.
• legend.add(legendTitle); :Adds the legendTitle label to the legend panel.
• var makeRow = function(color, name) {...}; :Defines a function makeRow that creates a row in the
legend with a color and a label name.
• var colorBox = ui.Label({...}); :Inside the makeRow function, this creates a label colorBox representing
the color box, styled with the specified background color, padding, and margin.
• var description = ui.Label({...}); : Inside the makeRow function, this creates a label description that
holds the name (e.g., "Flood Inundation" or "Water body") with some margin for spacing.
• return ui.Panel({...}); :Inside the makeRow function, returns a panel containing both the colorBox and
description, laid out horizontally.
• var palette = ['Yellow', 'Blue']; :Creates an array palette containing the colors for the legend: "Yellow"
for flood and "Blue" for water.
• var names = ['Flood Inundation', 'Water body']; :Creates an array names with the corresponding
names for each color.
• for (var i = 0; i < 2; i++) {...}; : Loops through the palette and names arrays, adding a row to the legend
for each color and name.
• legend.add(makeRow(palette[i], names[i])); Calls makeRow with the current color and name, then
adds the row to the legend panel.
• Map.add(legend); : Adds the completed legend to the map.
Now, If we run the entire code, we can see the map layers with map title and legend.

Data Source: Sentinel 1A


Pre-Flood Duration (images used between) : March 1, 2016 to April 10, 2016
Post-Flood Duration (images used between) : June 15, 2016 to August 6, 2016
Total District Area (sq.km): 1511.1028363267826
Flood Inundated Area (sq.km): 307.3161292477491
Waterbody Area (sq.km): 269.96430009213447

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
11. We can also export the before and after flood image for further analysis in any GIS Software. If we run the
entire code with the below exportation code, links will be generated in the task section for downloading
the image in google drive
Code:

// Export the before_filtered layer


Export.image.toDrive({
image: before_filtered,
description: 'Before_Filtered',
folder: 'FloodMapping', // Change this to your desired folder in Google Drive
fileNamePrefix: 'before_filtered',
scale: 30,
region: dt.geometry(),
maxPixels: 1e9
});
// Export the after_filtered layer
Export.image.toDrive({
image: after_filtered,
description: 'After_Filtered',
folder: 'FloodMapping',
fileNamePrefix: 'after_filtered',
scale: 30,
region: dt.geometry(),
maxPixels: 1e9
});

Explanation:

• Export.image.toDrive: Exports the before_filtered image layer to Google Drive.


o image: before_filtered: Specifies the image to export, which is the before_filtered layer.
o image: after_filtered, : Specifies the image to export, which is the after_filtered layer.
o description: 'Before_Filtered': Provides a name for the export task that will appear in the task
manager.
o folder: 'FloodMapping': Specifies the folder in Google Drive where the image will be saved (can
be changed to any preferred folder).
o fileNamePrefix: 'before_filtered': Sets the prefix for the exported file’s name.
o scale: 30: Specifies the resolution (in meters) of the exported image.
o region: dt.geometry(): Clips the export to the geographic extent defined by dt (the district
boundary).
o maxPixels: 1e9: Allows exporssting up to 1 billion pixels, setting a limit to avoid errors with large
images.

Pre-Flood Image Post-Flood Image

The Pre-Flood & Post-Flood images of Marigaon District are downloaded from GEE and the map layout is created in
ArcMap 10.8 Environment
Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
Entire Source Code for Flood Inundation Mapping
var dt = Assam.filter(ee.Filter.eq('Name', 'MARIGAON'));
Map.addLayer(dt);
Map.centerObject(dt);

var collection = ee.ImageCollection('COPERNICUS/S1_GRD')


.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
.filter(ee.Filter.eq('instrumentMode', 'IW'))
.filter(ee.Filter.or(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'), ee.Filter.eq('orbitProperties_pass',
'ASCENDING')));

//Filtering Images for Before and After the Flood and Creating mosaic images
var before = collection.filter(ee.Filter.date('2016-03-01', '2016-04-10')).filterBounds(dt);
var after = collection.filter(ee.Filter.date('2016-06-15', '2016-08-06')).filterBounds(dt);

print(before);
print(after);

var before_image = before.select('VH').mosaic().clip(dt);


var after_image = after.select('VH').mosaic().clip(dt);

// Application of Filter
var before_filtered = before_image.focal_median(30, "circle", "meters");
var after_filtered = after_image.focal_median(30, "circle", "meters");

//Masking out Flood Inundation and Water submerged layer


var flood = before_filtered.gt(-20).and(after_filtered.lt(-20));
var flood_mask = flood.updateMask(flood.eq(1));

var water = before_filtered.lt(-20).and(after_filtered.lt(-20));


var water_mask = water.updateMask(water.eq(1));

//Adding layer
Map.addLayer(before_filtered,{min:-25,max:0},'before_filtered')
Map.addLayer(after_filtered,{min:-25,max:0},'after_filtered')
Map.addLayer(flood_mask,{palette:['Yellow']},'Flood_Inundation')
Map.addLayer(water_mask,{palette:['Blue']},'Water')

// Area Calculations
var district_area = ee.Image.pixelArea().clip(dt);
var total_district_area = district_area.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: dt.geometry(),
scale: 30,
maxPixels: 1e9
}).get('area');
var total_district_area_km2 = ee.Number(total_district_area).divide(1e6);
print('Total District Area (sq.km):', total_district_area_km2);

var flood_area = ee.Image.pixelArea().updateMask(flood_mask).clip(dt);


var total_flood_area = flood_area.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: dt.geometry(),
scale: 30,
maxPixels: 1e9

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
}).get('area');
var total_flood_area_km2 = ee.Number(total_flood_area).divide(1e6);
print('Flood Inundated Area (sq.km):', total_flood_area_km2);

var water_area = ee.Image.pixelArea().updateMask(water_mask).clip(dt);


var total_water_area = water_area.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: dt.geometry(),
scale: 30,
maxPixels: 1e9
}).get('area');
var total_water_area_km2 = ee.Number(total_water_area).divide(1e6);
print('Waterbody Area (sq.km):', total_water_area_km2);

//Map Layout
// Set position of panel
var legend = ui.Panel({
style: {
position: 'bottom-left',
padding: '8px 15px'
}
});

// Create legend title


var legendTitle = ui.Label({
value: 'Legend',
style: {
fontWeight: 'bold',
fontSize: '20px',
margin: '0 0 4px 0',
padding: '0'
}
});

// Add the title to the panel


legend.add(legendTitle);

// Creates and styles 1 row of the legend.


var makeRow = function(color, name) {
var colorBox = ui.Label({
style: {
backgroundColor: color,
padding: '14px',
margin: '0 0 4px 0'
}
});
var description = ui.Label({
value: name,
style: {margin: '0 0 4px 6px'}
});
return ui.Panel({
widgets: [colorBox, description],
layout: ui.Panel.Layout.Flow('horizontal')
});
};

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
// Palette with the colors
var palette = ['Yellow', 'Blue'];
// Names of the legend
var names = ['Flood Inundation', 'Water body'];
// Add color and names
for (var i = 0; i < 2; i++) {
legend.add(makeRow(palette[i], names[i]));
}

// Add legend to map


Map.add(legend);
// Set position of title panel
var title = ui.Panel({
style: {
position: 'top-center',
padding: '8px 15px'
}
});
// Create map title
var mapTitle = ui.Label({
value: 'Flood Inundation Mapping of Marigaon District, Assam',
style: {
fontWeight: 'bold',
fontSize: '28px',
margin: '0 0 4px 0',
padding: '0'
}
});

// Add title to panel


title.add(mapTitle);
Map.add(title);

// Export the before_filtered layer


Export.image.toDrive({
image: before_filtered,
description: 'Before_Filtered',
folder: 'FloodMapping', // Change this to your desired folder in Google Drive
fileNamePrefix: 'before_filtered',
scale: 30,
region: dt.geometry(),
maxPixels: 1e9
});
// Export the after_filtered layer
Export.image.toDrive({
image: after_filtered,
description: 'After_Filtered',
folder: 'FloodMapping',
fileNamePrefix: 'after_filtered',
scale: 30,
region: dt.geometry(),
maxPixels: 1e9
});

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/
In conclusion, by following these steps, you can effectively perform flood inundation mapping using Sentinel-1A
SAR data in Google Earth Engine. This method is particularly useful due to the advantages of SAR data The
resulting maps provide critical information for disaster management and can be valuable for further
environmental and socio-economic assessments.
Important Abbreviations from table I

➢ SAR - Synthetic Aperture Radar: A type of radar that creates 2D images or 3D reconstructions of
objects, such as landscapes.
➢ HH - Horizontal-Horizontal Polarization: Refers to the polarization of the transmitted and received
radar signal in a horizontal orientation.
➢ VV - Vertical-Vertical Polarization: Refers to the polarization of the transmitted and received radar
signal in a vertical orientation.
➢ HV - Horizontal-Vertical Polarization: Refers to the transmitted signal being horizontal and the received
signal being vertical.
➢ VH - Vertical-Horizontal Polarization: Refers to the transmitted signal being vertical and the received
signal being horizontal.
➢ FBS - Fine Beam Spotlight: A mode that provides high-resolution images.
➢ FBD - Fine Beam Dual: A mode that captures images using two different polarizations.
➢ PLR - Partial Polarimetric Radar: A mode that can capture data with multiple polarizations.
➢ ScanSAR - Scan Synthetic Aperture Radar: A mode that allows for wide-area imaging but at lower
resolution.
➢ Polarization: The orientation of the radar wave's electric field. It can be horizontal (H) or vertical (V),
and different polarization combinations (like HH, VV, HV, VH) can provide different information about
the surface being imaged.
➢ Resolution: The ability of a radar system to distinguish between two closely spaced objects. It can be
described in terms of:
o Azimuth Resolution (Az): The resolution in the direction of the radar beam.
o Range Resolution (Rg): The resolution in the direction away from the radar.
➢ IW - Interferometric Wide Swath: A mode that captures images over a wide area.
➢ EW - Extra Wide Swath: A mode that captures even broader areas compared to IW.
➢ L-band - Refers to radar wavelengths in the range of 1 to 2 GHz (24.6 cm wavelength).
➢ C-band - Refers to radar wavelengths in the range of 4 to 8 GHz (5.6 cm wavelength).
➢ X-band - Refers to radar wavelengths in the range of 8 to 12 GHz (3.5 cm wavelength).
➢ HH/VV - Refers to dual polarization modes, indicating both horizontal and vertical measurements.
➢ Spotlight - A mode that focuses on a small area to achieve high resolution.
➢ Stripmap - A mode that captures continuous strips of data.
➢ Repeat Cycle - The time taken for a satellite to return to the same position over the same area for
imaging.
➢ NASA - National Aeronautics and Space Administration: The United States government agency
responsible for the nation's civilian space program.
➢ ESA - European Space Agency: An intergovernmental organization dedicated to the exploration of
space.
➢ JAXA - Japan Aerospace Exploration Agency: The Japanese national aerospace and space agency.
➢ CSA - Canadian Space Agency: The national agency responsible for space research and technology in
Canada.
➢ DLR - German Aerospace Center: The national center for aerospace, energy, and transportation
research in Germany.
➢ ASI - Italian Space Agency: The governmental agency responsible for the coordination of Italy's space
program.

Sukanya Mandal
https://www.linkedin.com/in/sukanya-mandal-177b2419a/

You might also like