Difference between revisions of "Tropical Flood Mapping and Area Calculation of Flood Extent Using Sentinel-I SAR Data in Google Earth Engine: the case of Super Typhoon Odette (Rai)"

From CUOSGwiki
Jump to navigationJump to search
Line 68: Line 68:
 
* Hold the '''Ctrl button''' on your keyboard, and choose three files: '''''gadm36_PHL_1.dbf''''', '''''gadm36_PHL_1.shp''''', and '''''gadm36_PHL_1.shx''''' and click '''Open'''.
 
* Hold the '''Ctrl button''' on your keyboard, and choose three files: '''''gadm36_PHL_1.dbf''''', '''''gadm36_PHL_1.shp''''', and '''''gadm36_PHL_1.shx''''' and click '''Open'''.
 
* Create an optional name for these files under Asset ID. This can be helpful to easily recognize your uploaded files. However, for this tutorial, we will name it '''PH_Lev1'''.
 
* Create an optional name for these files under Asset ID. This can be helpful to easily recognize your uploaded files. However, for this tutorial, we will name it '''PH_Lev1'''.
* Then click '''UPLOAD'''.
+
* Then click '''UPLOAD'''.<br>
  +
  +
Uploading this file may take a few minutes. You can check the status of the upload by clicking the '''Tasks''' tab on the left panel of the Code Editor. The ''“Ingest Table”'' will turn blue when it is complete.
  +
* Import the file to the script by clicking the '''Assets''' tab on the right panel, and under your username, you should be able to find the uploaded shapefile.
  +
* Hover your mouse on the '''PH_Lev1''', and on the rightmost side, you will see a small arrow that indicates '''“Import into script”'''. Click that arrow.
  +
* After importing the file, click this icon [[File:Screenshot (6).png|frameless]] found in your code editor, and copy and paste the generated code in the empty code editor. <br>
  +
  +
* Replace the word ''table'' with ''admin''. It should be like this:
  +
'''Note:''' The ''yourname'' section in the code depends on your username. Do not copy it.
  +
<syntaxhighlight lang="javascript">var admin = ee.FeatureCollection("users/yourname/PH_Lev1");</syntaxhighlight>
  +
  +
* Since we only need the province of Southern Leyte, a filtering function should be applied. Use the code below:
  +
<syntaxhighlight lang="javascript">var geometry=admin.filter(ee.Filter.eq('NAME_1','Southern Leyte'));</syntaxhighlight>
  +
  +
* Then generate a map with your desired colour. For this tutorial, we will use the colour grey. Use the code below:
  +
<syntaxhighlight lang="javascript">Map.addLayer(geometry,{color:'grey'},'Southern Leyte');</syntaxhighlight>
  +
  +
* Finally, click '''Run''', and you can see that your map section has zoomed in the area of interest and highlighted into grey colour. This indicates your study area.<br>
  +
   
 
===Step 2. Setting the time frame===
 
===Step 2. Setting the time frame===
  +
   
 
===Step 3. Selection of Sensor Parameters===
 
===Step 3. Selection of Sensor Parameters===

Revision as of 18:48, 23 December 2021

Introduction

Purpose and Overview

Area of Interest: Southern Leyte, Philippines

This tutorial aims to produce a map showing the flood extent of the affected areas. This can be achieved by building scripts to gather satellite images taken before and after a flood event and comparing them. Google Earth Engine provides large-scale visualization and analysis of geospatial data, particularly Sentinel-I SAR GRD imagery. This approach is used due to its resistance to weather and cloud cover; thus, it is a reliable way to detect flooded regions.

The Google Earth Engine (GEE) is a free, planetary-scale platform software used for educational and operational research and non-profit use. This open software developed by Google has been used to operate various studies on a global and regional scale, including Land Use and Land Cover (LULC), flood mapping, surface water mapping, and other applications.

Flood mapping is important especially in tropical regions because these areas are prone to typhoons and cyclones and are usually surrounded by open waters. This is crucial during the immediate response phase to make decisions on evacuations, calculating the extent of damages, and appropriate deployment of aid for the victims.


Area of Interest

On December 16, 2021, a super typhoon Odette or Rai, as named internationally, severely affected the Visayas and Mindanao group of islands in the Philippines. This typhoon fell on a Category-5 scale and was considered as one of the strongest storms that struck the country.

In this tutorial, the area of interest will be in the province of Southern Leyte, located in the Eastern Visayas Region of the Philippines. This area is chosen because there were not a lot of GIS articles written about this phenomenon, since it only occurred a week ago. In this way, the flood extent of Southern Leyte will be determined while learning how to generate it using Google Earth Engine.


Setting up Google Earth Engine

Google Earth Engine is a web-based integrated development environment (IDE) for JavaScript API and a cloud-based geospatial procession platform. To make sure that working in this software is fast and easy, you should have a Google Earth Engine account.


Creating an account

Note: This step usually takes 1 - 2 days for approval. Do this as soon as possible.


To ensure a hassle-free sign-up process, follow these tips:

  • Use Google Chrome browser.
  • If you have multiple Google accounts, make sure that you are logged in to the account that you want to be associated with Earth Engine.


Components of Google Earth Engine Code Editor

After going to the website, you should see the entire components of the Earth Engine Code Editor:

Diagram of components of the Earth Engine Code Editor.

Setting up your repository

You need to create your Owner repository folder to be able to save your codes and files. To do this:

  • Click the NEW button on the right side of the editor.
  • Click Repository.
  • Write a repository name of your choice. It must be unique, and you cannot change it later.
  • When you save your scripts later, they will be saved under the Owner section.


Tutorial

Preparing your data

To prepare your data, follow these steps:

  • Download the shapefile of the Philippine administrative area in GADM here.
  • Choose Philippines in the country drop-down menu.
  • Click Shapefile. The zip file download will start automatically.
  • In your Downloads file location, extract the zip file into a different folder by right-clicking it and choosing Extract to gadm36_PHL_shp/. There should be a folder in the same location.

Note: You will only need Level 1 shapefiles for this tutorial.


Step 1. Selection of Study Area

This information is vital to limit the extent of the analysis and avoid unnecessary calculations. In this tutorial, we will be focusing on the provincial boundary of Southern Leyte, Philippines. There are a few ways to specify the location of your study area (polygon tool or GEE FeatureCollection) and uploading a shapefile (.shp) is the most accurate solution.
Note: Make sure to include .dbx and .shx files because your shapefile depends on them.

To upload the shapefiles that you downloaded earlier:

  • Go to Assets tab on the right side of the Code Editor.
  • Click NEW, and select Shape Files.
  • Click SELECT, and go to the location of the extracted folder named gadm36_PHL_shp.
  • Hold the Ctrl button on your keyboard, and choose three files: gadm36_PHL_1.dbf, gadm36_PHL_1.shp, and gadm36_PHL_1.shx and click Open.
  • Create an optional name for these files under Asset ID. This can be helpful to easily recognize your uploaded files. However, for this tutorial, we will name it PH_Lev1.
  • Then click UPLOAD.

Uploading this file may take a few minutes. You can check the status of the upload by clicking the Tasks tab on the left panel of the Code Editor. The “Ingest Table” will turn blue when it is complete.

  • Import the file to the script by clicking the Assets tab on the right panel, and under your username, you should be able to find the uploaded shapefile.
  • Hover your mouse on the PH_Lev1, and on the rightmost side, you will see a small arrow that indicates “Import into script”. Click that arrow.
  • After importing the file, click this icon Screenshot (6).png found in your code editor, and copy and paste the generated code in the empty code editor.
  • Replace the word table with admin. It should be like this:

Note: The yourname section in the code depends on your username. Do not copy it.

var admin = ee.FeatureCollection("users/yourname/PH_Lev1");
  • Since we only need the province of Southern Leyte, a filtering function should be applied. Use the code below:
var geometry=admin.filter(ee.Filter.eq('NAME_1','Southern Leyte'));
  • Then generate a map with your desired colour. For this tutorial, we will use the colour grey. Use the code below:
Map.addLayer(geometry,{color:'grey'},'Southern Leyte');
  • Finally, click Run, and you can see that your map section has zoomed in the area of interest and highlighted into grey colour. This indicates your study area.


Step 2. Setting the time frame

Step 3. Selection of Sensor Parameters

Step 4. Running the script

Step 5. Visualizing Results in Google Earth Engine

Step 6. Exporting generated products

Step 7. Refining the Flood Extent layer

Step 8. Area calculation of flood extent

Conclusion

References