├── AUGFloodedArea_TIFF18.tif ├── AUGFloodedArea_TIFF19.tif ├── AUGFloodedArea_TIFF20.tif ├── AUGFloodedArea_TIFF21.tif ├── AUGFloodedArea_TIFF22.tif ├── AUGFloodedArea_TIFF23.tif ├── AUGFloodedArea_TIFF24.tif ├── NOVFloodedArea_TIFF18.tif ├── NOVFloodedArea_TIFF19.tif ├── NOVFloodedArea_TIFF20.tif ├── NOVFloodedArea_TIFF21.tif ├── NOVFloodedArea_TIFF22.tif ├── NOVFloodedArea_TIFF23.tif ├── OCTFloodedArea_TIFF18.tif ├── OCTFloodedArea_TIFF21.tif ├── OCTFloodedArea_TIFF24.tif ├── SEPFloodedArea_TIFF19.tif ├── SEPFloodedArea_TIFF20.tif ├── SEPFloodedArea_TIFF22.tif ├── SEPFloodedArea_TIFF23.tif ├── SEPFloodedArea_TIFF24.tif ├── NOVFloodedArea _2024_TIFF.tif ├── OCTFloodedArea_2019_TIFF.tif ├── OCTFloodedArea_2020_TIFF.tif ├── OCTFloodedArea_2022_TIFF.tif ├── OCTFloodedArea_2023_TIFF.tif ├── SEPFloodedArea_2018_TIFF.tif ├── SEPFloodedArea_2021_TIFF.tif ├── Flood ├── FLOOD.txt └── README.md /AUGFloodedArea_TIFF18.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF18.tif -------------------------------------------------------------------------------- /AUGFloodedArea_TIFF19.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF19.tif -------------------------------------------------------------------------------- /AUGFloodedArea_TIFF20.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF20.tif -------------------------------------------------------------------------------- /AUGFloodedArea_TIFF21.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF21.tif -------------------------------------------------------------------------------- /AUGFloodedArea_TIFF22.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF22.tif -------------------------------------------------------------------------------- /AUGFloodedArea_TIFF23.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF23.tif -------------------------------------------------------------------------------- /AUGFloodedArea_TIFF24.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/AUGFloodedArea_TIFF24.tif -------------------------------------------------------------------------------- /NOVFloodedArea_TIFF18.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea_TIFF18.tif -------------------------------------------------------------------------------- /NOVFloodedArea_TIFF19.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea_TIFF19.tif -------------------------------------------------------------------------------- /NOVFloodedArea_TIFF20.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea_TIFF20.tif -------------------------------------------------------------------------------- /NOVFloodedArea_TIFF21.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea_TIFF21.tif -------------------------------------------------------------------------------- /NOVFloodedArea_TIFF22.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea_TIFF22.tif -------------------------------------------------------------------------------- /NOVFloodedArea_TIFF23.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea_TIFF23.tif -------------------------------------------------------------------------------- /OCTFloodedArea_TIFF18.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_TIFF18.tif -------------------------------------------------------------------------------- /OCTFloodedArea_TIFF21.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_TIFF21.tif -------------------------------------------------------------------------------- /OCTFloodedArea_TIFF24.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_TIFF24.tif -------------------------------------------------------------------------------- /SEPFloodedArea_TIFF19.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_TIFF19.tif -------------------------------------------------------------------------------- /SEPFloodedArea_TIFF20.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_TIFF20.tif -------------------------------------------------------------------------------- /SEPFloodedArea_TIFF22.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_TIFF22.tif -------------------------------------------------------------------------------- /SEPFloodedArea_TIFF23.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_TIFF23.tif -------------------------------------------------------------------------------- /SEPFloodedArea_TIFF24.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_TIFF24.tif -------------------------------------------------------------------------------- /NOVFloodedArea _2024_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/NOVFloodedArea _2024_TIFF.tif -------------------------------------------------------------------------------- /OCTFloodedArea_2019_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_2019_TIFF.tif -------------------------------------------------------------------------------- /OCTFloodedArea_2020_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_2020_TIFF.tif -------------------------------------------------------------------------------- /OCTFloodedArea_2022_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_2022_TIFF.tif -------------------------------------------------------------------------------- /OCTFloodedArea_2023_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/OCTFloodedArea_2023_TIFF.tif -------------------------------------------------------------------------------- /SEPFloodedArea_2018_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_2018_TIFF.tif -------------------------------------------------------------------------------- /SEPFloodedArea_2021_TIFF.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akajiaku11/Flood-Mapping-and-Monitoring-in-Niger-Delta-Nigeria-/HEAD/SEPFloodedArea_2021_TIFF.tif -------------------------------------------------------------------------------- /Flood: -------------------------------------------------------------------------------- 1 | projects/ee-desmondeteh/assets/Niger_Delta_ 2 | // Define the time period for analysis 3 | var startDate = '2022-09-20'; 4 | var endDate = '2022-10-30'; 5 | 6 | // Load Sentinel-1 SAR dataset 7 | var sentinel1 = ee.ImageCollection('COPERNICUS/S1_GRD') 8 | .filterBounds(aoi) 9 | .filterDate(startDate, endDate) 10 | .filter(ee.Filter.eq('instrumentMode', 'IW')) 11 | .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING')) 12 | .filter(ee.Filter.eq('resolution_meters', 10)) 13 | .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV')) 14 | .select('VV'); 15 | 16 | // Create a median composite image for the period 17 | var medianImage = sentinel1.median().clip(aoi); 18 | 19 | // Threshold to identify flood areas (adjust the threshold value based on your AOI) 20 | var floodThreshold = -11; 21 | var floodedArea = medianImage.lt(floodThreshold).selfMask(); 22 | var nonFloodedArea = medianImage.gte(floodThreshold).selfMask(); 23 | 24 | // Display the results 25 | Map.centerObject(aoi, 10); 26 | Map.addLayer(floodedArea, {palette: ['red'], min: 0, max: 1}, 'Flooded Area'); 27 | Map.addLayer(nonFloodedArea, {palette: ['blue'], min: 0, max: 1}, 'Non-Flooded Area'); 28 | 29 | // Calculate flood area statistics 30 | var floodArea = floodedArea.multiply(ee.Image.pixelArea()).reduceRegion({ 31 | reducer: ee.Reducer.sum(), 32 | geometry: aoi, 33 | scale: 10, 34 | crs: 'EPSG:4326', 35 | maxPixels: 1e10 36 | }); 37 | 38 | var nonFloodArea = nonFloodedArea.multiply(ee.Image.pixelArea()).reduceRegion({ 39 | reducer: ee.Reducer.sum(), 40 | geometry: aoi, 41 | scale: 10, 42 | crs: 'EPSG:4326', 43 | maxPixels: 1e10 44 | }); 45 | 46 | // Print the results 47 | print('Flooded Area (m^2): ', floodArea.get('VV')); 48 | print('Non-Flooded Area (m^2): ', nonFloodArea.get('VV')); 49 | 50 | // Create a chart to visualize the flood and non-flood areas 51 | var chart = ui.Chart.array.values({ 52 | array: [floodArea.get('VV'), nonFloodArea.get('VV')], 53 | axis: 0 54 | }) 55 | .setChartType('PieChart') 56 | .setOptions({ 57 | title: 'Flood vs Non-Flood Areas', 58 | slices: [{color: 'red'}, {color: 'blue'}], 59 | labels: ['Flooded Area', 'Non-Flooded Area'] 60 | }); 61 | 62 | print(chart); 63 | 64 | // Export the flooded area as a TIFF file 65 | Export.image.toDrive({ 66 | image: floodedArea, 67 | description: 'FloodedArea_TIFF', 68 | scale: 100, 69 | region: aoi, 70 | crs: 'EPSG:4326', 71 | maxPixels: 1e8, 72 | fileFormat: 'GeoTIFF' 73 | }); 74 | 75 | // Export the non-flooded area as a TIFF file 76 | Export.image.toDrive({ 77 | image: nonFloodedArea, 78 | description: 'NonFloodedArea_TIFF', 79 | scale: 100, 80 | region: aoi, 81 | crs: 'EPSG:4326', 82 | maxPixels: 1e8, 83 | fileFormat: 'GeoTIFF' 84 | }); 85 | -------------------------------------------------------------------------------- /FLOOD.txt: -------------------------------------------------------------------------------- 1 | Creating a New Repository and Automating Flood Mapping and Monitoring in Nigeria 2 | 3 | The process of creating a new Git repository using the command line, combined with running code for flood mapping and monitoring, can provide a powerful workflow for managing geospatial data and analysis projects. The steps below outline both aspects in detail: creating a GitHub repository and implementing a flood mapping and monitoring workflow using Sentinel-1 SAR data in Google Earth Engine (GEE). 4 | Step 1: Setting up a GitHub Repository Using Command Line 5 | 6 | A GitHub repository allows you to version-control your project, making it easier to track changes, collaborate, and manage the codebase. Here's a breakdown of the commands to create and initialize a Git repository, commit the project files, and push them to GitHub. 7 | 8 | Create a README file: 9 | 10 | bash 11 | 12 | echo "# Flood-Mapping-and-Monitoring-in-Nigeria" >> README.md 13 | 14 | This command creates a README.md file, which is essential in any repository. It helps describe the project and its purpose. 15 | 16 | Initialize a Git repository: 17 | 18 | csharp 19 | 20 | git init 21 | 22 | This command initializes a new Git repository in your local project folder, setting up version control. 23 | 24 | Add the README file to the repository: 25 | 26 | csharp 27 | 28 | git add README.md 29 | 30 | This command stages the README.md file for committing. It indicates the file is ready to be tracked by Git. 31 | 32 | Commit the staged files: 33 | 34 | sql 35 | 36 | git commit -m "first commit" 37 | 38 | A commit represents a snapshot of your project. Here, the -m option allows you to include a message ("first commit") explaining what the commit contains. 39 | 40 | Create the main branch: 41 | 42 | css 43 | 44 | git branch -M main 45 | 46 | This command renames the current branch to main, which is typically the default branch in most repositories. 47 | 48 | Add the remote repository: 49 | 50 | scss 51 | 52 | git remote add origin git@github.com:eteh1/Flood-Mapping-and-Monitoring-in-Nigeria.git 53 | 54 | This command links your local repository to the remote repository hosted on GitHub, enabling you to push code and collaborate online. 55 | 56 | Push the code to the remote repository: 57 | 58 | css 59 | 60 | git push -u origin main 61 | 62 | This command pushes your local commits to the main branch of the remote repository, making the project available online. 63 | 64 | Step 2: Automating Flood Mapping Using Sentinel-1 SAR in Google Earth Engine 65 | 66 | Flood mapping and monitoring can be efficiently conducted using Sentinel-1 Synthetic Aperture Radar (SAR) data. SAR has the advantage of penetrating clouds and capturing high-resolution data, making it ideal for flood detection. In this section, we'll explain how to automate flood detection in Nigeria using Google Earth Engine (GEE). 67 | 1. Define the Area of Interest (AOI) 68 | 69 | The first step in the flood mapping process is to define the geographic region of interest. In this example, we are using a predefined asset for the Niger Delta in Nigeria: 70 | 71 | javascript 72 | 73 | var aoi = projects/ee-desmondeteh/assets/Niger_Delta_; 74 | 75 | This line loads a predefined boundary for the Niger Delta. The asset can be uploaded from a shapefile or manually drawn in GEE. 76 | 2. Define the Time Period for Analysis 77 | 78 | Flood events are time-specific, so it’s crucial to filter the data by the appropriate date range: 79 | 80 | javascript 81 | 82 | var startDate = '2022-09-20'; 83 | var endDate = '2022-10-30'; 84 | 85 | In this case, we are looking for flood events occurring between September and October 2022. 86 | 3. Load and Filter Sentinel-1 SAR Data 87 | 88 | Sentinel-1 is an active radar mission that provides reliable data for flood detection. By filtering based on time, location, and image characteristics, you can narrow down the dataset to the images that are relevant for flood detection: 89 | 90 | javascript 91 | 92 | var sentinel1 = ee.ImageCollection('COPERNICUS/S1_GRD') 93 | .filterBounds(aoi) 94 | .filterDate(startDate, endDate) 95 | .filter(ee.Filter.eq('instrumentMode', 'IW')) 96 | .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING')) 97 | .filter(ee.Filter.eq('resolution_meters', 10)) 98 | .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV')) 99 | .select('VV'); 100 | 101 | Here, we filter the data based on orbit pass, polarization, and resolution, selecting only the Vertical-Vertical (VV) polarization images, which are useful for detecting changes in surface water. 102 | 4. Create a Composite Image 103 | 104 | To create a clearer image that reduces noise, we use the median composite: 105 | 106 | javascript 107 | 108 | var medianImage = sentinel1.median().clip(aoi); 109 | 110 | This step creates a median image of all the filtered SAR data, clipping it to the area of interest. 111 | 5. Identify Flooded Areas 112 | 113 | Flood detection is achieved by applying a threshold to the radar backscatter. Areas with lower radar backscatter values (below the threshold) typically indicate water surfaces: 114 | 115 | javascript 116 | 117 | var floodThreshold = -11; 118 | var floodedArea = medianImage.lt(floodThreshold).selfMask(); 119 | var nonFloodedArea = medianImage.gte(floodThreshold).selfMask(); 120 | 121 | In this case, a threshold of -11 is applied, but it can be adjusted based on the specific characteristics of the flood event and region. 122 | 6. Display Results on the Map 123 | 124 | The results are displayed on the map with different colors representing flooded and non-flooded areas: 125 | 126 | javascript 127 | 128 | Map.centerObject(aoi, 10); 129 | Map.addLayer(floodedArea, {palette: ['red'], min: 0, max: 1}, 'Flooded Area'); 130 | Map.addLayer(nonFloodedArea, {palette: ['blue'], min: 0, max: 1}, 'Non-Flooded Area'); 131 | 132 | Flooded areas are shown in red, while non-flooded areas are shown in blue. 133 | 7. Calculate Flood Area Statistics 134 | 135 | To quantify the extent of the flooding, the code calculates the total flooded area in square meters: 136 | 137 | javascript 138 | 139 | var floodArea = floodedArea.multiply(ee.Image.pixelArea()).reduceRegion({ 140 | reducer: ee.Reducer.sum(), 141 | geometry: aoi, 142 | scale: 10, 143 | crs: 'EPSG:4326', 144 | maxPixels: 1e10 145 | }); 146 | 147 | The same calculation is done for non-flooded areas. 148 | 8. Visualize Flood Data 149 | 150 | A pie chart provides a visual comparison of flooded versus non-flooded areas: 151 | 152 | javascript 153 | 154 | var chart = ui.Chart.array.values({ 155 | array: [floodArea.get('VV'), nonFloodArea.get('VV')], 156 | axis: 0 157 | }) 158 | .setChartType('PieChart') 159 | .setOptions({ 160 | title: 'Flood vs Non-Flood Areas', 161 | slices: [{color: 'red'}, {color: 'blue'}], 162 | labels: ['Flooded Area', 'Non-Flooded Area'] 163 | }); 164 | 165 | 9. Export the Flood Maps 166 | 167 | Finally, the flooded and non-flooded areas are exported as GeoTIFFs for further analysis: 168 | 169 | javascript 170 | 171 | Export.image.toDrive({ 172 | image: floodedArea, 173 | description: 'FloodedArea_TIFF', 174 | scale: 100, 175 | region: aoi, 176 | crs: 'EPSG:4326', 177 | maxPixels: 1e8, 178 | fileFormat: 'GeoTIFF' 179 | }); 180 | 181 | The exported TIFF files can be used in other GIS platforms or for reporting purposes. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Flood Mapping and Monitoring in Nigeria 2 | 3 | Welcome to the repository for Flood Mapping and Monitoring in Nigeria, a project aimed at using geospatial technology to analyze and visualize flood-prone areas in the Niger Delta, Nigeria. This project leverages Google Earth Engine (GEE) and Sentinel-1 Synthetic Aperture Radar (SAR) data for accurate flood detection and monitoring. 4 | Introduction 5 | 6 | Flooding is a major environmental and socio-economic challenge in Nigeria, particularly in the Niger Delta region. This region experiences frequent flooding due to its low-lying terrain, poor drainage systems, and high rainfall during the rainy season. Flooding leads to displacement, destruction of property, and disruption of livelihoods. To mitigate and manage the effects of floods, there is a need for continuous monitoring, early warning systems, and accurate mapping of flood-prone areas. 7 | 8 | The Flood Mapping and Monitoring in Nigeria project aims to provide a comprehensive framework for flood detection and mapping using satellite imagery, which can be integrated into disaster management systems to enhance flood prediction, preparedness, and response. 9 | Project Overview 10 | 11 | This project uses Sentinel-1 SAR data from the European Space Agency's Copernicus program, processed within the Google Earth Engine (GEE) environment. Sentinel-1's SAR capabilities are especially useful for flood detection as it can capture imagery regardless of cloud cover or light conditions, making it ideal for real-time flood monitoring. 12 | Objectives 13 | 14 | To detect and map flooded areas in the Niger Delta region using Sentinel-1 SAR imagery. 15 | To calculate the extent of flooded and non-flooded areas. 16 | To create visualizations that can help policymakers and disaster management agencies understand the flood dynamics. 17 | To export flood and non-flood data as GeoTIFF files for further analysis. 18 | 19 | Key Features 20 | 21 | Flood Detection: Identification of flood-prone areas using SAR data. 22 | Visualization: Visual representation of flooded vs. non-flooded areas using custom maps and charts. 23 | Export Capabilities: Export of flood data in GeoTIFF format for use in GIS and other analytical platforms. 24 | 25 | Technology Stack 26 | 27 | Google Earth Engine (GEE): A cloud-based platform that allows for large-scale geospatial analysis. 28 | Sentinel-1 SAR Data: A radar-based satellite dataset that provides high-resolution data for flood detection. 29 | Git & GitHub: Version control and collaboration. 30 | 31 | Instructions for Running the Project 32 | 33 | Follow the instructions below to clone the repository, initialize the project, and run the flood detection script using Google Earth Engine. 34 | Step 1: Clone the Repository 35 | 36 | bash 37 | 38 | git clone git@github.com:eteh1/Flood-Mapping-and-Monitoring-in-Nigeria.git 39 | 40 | This command will create a local copy of the repository on your machine. 41 | Step 2: Initialize the Repository and Set Up Git 42 | 43 | If this is your first time setting up the project, you'll need to initialize the Git repository. 44 | 45 | bash 46 | 47 | git init 48 | git add README.md 49 | git commit -m "first commit" 50 | git branch -M main 51 | git remote add origin git@github.com:eteh1/Flood-Mapping-and-Monitoring-in-Nigeria.git 52 | git push -u origin main 53 | 54 | Step 3: Define the Area of Interest (AOI) 55 | 56 | You can define the Area of Interest (AOI) as follows: 57 | 58 | javascript 59 | 60 | // Define your Area of Interest (AOI) 61 | var aoi = projects/ee-desmondeteh/assets/Niger_Delta_; 62 | 63 | Replace Niger_Delta_ with your specific area of interest (AOI) in the Google Earth Engine environment. 64 | Step 4: Define the Time Period for Analysis 65 | 66 | Specify the time period during which you want to analyze flood events: 67 | 68 | javascript 69 | 70 | var startDate = '2022-09-20'; 71 | var endDate = '2022-10-30'; 72 | 73 | Modify the startDate and endDate variables based on your needs. 74 | Step 5: Load and Filter Sentinel-1 SAR Data 75 | 76 | Load Sentinel-1 SAR data from GEE and filter it according to specific criteria: 77 | 78 | javascript 79 | 80 | var sentinel1 = ee.ImageCollection('COPERNICUS/S1_GRD') 81 | .filterBounds(aoi) 82 | .filterDate(startDate, endDate) 83 | .filter(ee.Filter.eq('instrumentMode', 'IW')) 84 | .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING')) 85 | .filter(ee.Filter.eq('resolution_meters', 10)) 86 | .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV')) 87 | .select('VV'); 88 | 89 | Step 6: Create a Median Composite Image 90 | 91 | Create a median composite image for the defined time period: 92 | 93 | javascript 94 | 95 | var medianImage = sentinel1.median().clip(aoi); 96 | 97 | This step ensures that the SAR imagery is aggregated and clipped to the AOI for further analysis. 98 | Step 7: Identify Flooded Areas 99 | 100 | Apply a threshold to identify flooded areas. Adjust the floodThreshold variable based on the AOI to improve accuracy: 101 | 102 | javascript 103 | 104 | var floodThreshold = -11; 105 | var floodedArea = medianImage.lt(floodThreshold).selfMask(); 106 | var nonFloodedArea = medianImage.gte(floodThreshold).selfMask(); 107 | 108 | Step 8: Visualize the Results 109 | 110 | Display the flooded and non-flooded areas on the map: 111 | 112 | javascript 113 | 114 | Map.centerObject(aoi, 10); 115 | Map.addLayer(floodedArea, {palette: ['red'], min: 0, max: 1}, 'Flooded Area'); 116 | Map.addLayer(nonFloodedArea, {palette: ['blue'], min: 0, max: 1}, 'Non-Flooded Area'); 117 | 118 | Step 9: Calculate Flood Area Statistics 119 | 120 | You can calculate the total flooded and non-flooded areas in square meters using the following code: 121 | 122 | javascript 123 | 124 | var floodArea = floodedArea.multiply(ee.Image.pixelArea()).reduceRegion({ 125 | reducer: ee.Reducer.sum(), 126 | geometry: aoi, 127 | scale: 10, 128 | crs: 'EPSG:4326', 129 | maxPixels: 1e10 130 | }); 131 | 132 | var nonFloodArea = nonFloodedArea.multiply(ee.Image.pixelArea()).reduceRegion({ 133 | reducer: ee.Reducer.sum(), 134 | geometry: aoi, 135 | scale: 10, 136 | crs: 'EPSG:4326', 137 | maxPixels: 1e10 138 | }); 139 | 140 | Step 10: Visualize Flood Statistics with a Pie Chart 141 | 142 | Visualize the flooded and non-flooded areas using a simple pie chart: 143 | 144 | javascript 145 | 146 | var chart = ui.Chart.array.values({ 147 | array: [floodArea.get('VV'), nonFloodArea.get('VV')], 148 | axis: 0 149 | }) 150 | .setChartType('PieChart') 151 | .setOptions({ 152 | title: 'Flood vs Non-Flood Areas', 153 | slices: [{color: 'red'}, {color: 'blue'}], 154 | labels: ['Flooded Area', 'Non-Flooded Area'] 155 | }); 156 | 157 | print(chart); 158 | 159 | Step 11: Export Flood and Non-Flood Data 160 | 161 | Export the flood and non-flooded areas as GeoTIFF files for further analysis in GIS software: 162 | 163 | javascript 164 | 165 | // Export the flooded area as a TIFF file 166 | Export.image.toDrive({ 167 | image: floodedArea, 168 | description: 'FloodedArea_TIFF', 169 | scale: 100, 170 | region: aoi, 171 | crs: 'EPSG:4326', 172 | maxPixels: 1e8, 173 | fileFormat: 'GeoTIFF' 174 | }); 175 | 176 | // Export the non-flooded area as a TIFF file 177 | Export.image.toDrive({ 178 | image: nonFloodedArea, 179 | description: 'NonFloodedArea_TIFF', 180 | scale: 100, 181 | region: aoi, 182 | crs: 'EPSG:4326', 183 | maxPixels: 1e8, 184 | fileFormat: 'GeoTIFF' 185 | }); 186 | 187 | Conclusion 188 | 189 | The Flood Mapping and Monitoring in Nigeria project demonstrates the power of remote sensing and geospatial technology in disaster risk management. By using SAR imagery from Sentinel-1, we can identify flood-prone areas in real-time, calculate the extent of the flooding, and provide valuable data to stakeholders for effective disaster response. 190 | https://code.earthengine.google.com/08bca8b64c0894e29cee5117346c22fa 191 | 192 | The project can be further expanded by integrating rainfall data, digital elevation models, and socio-economic data to improve flood prediction models. Additionally, the use of machine learning algorithms can help in automating the process and increasing the accuracy of flood detection. 193 | 194 | Feel free to fork, contribute, and expand the project to suit other regions or applications. 195 | License 196 | 197 | This project is licensed under the MIT License - see the LICENSE file for details. 198 | 199 | Acknowledgements 200 | 201 | We would like to acknowledge the use of Google Earth Engine and the European Space Agency's Copernicus program for providing the Sentinel-1 SAR dataset. This project would not have been possible without their contributions to the field of remote sensing and geospatial analysis. 202 | --------------------------------------------------------------------------------