Practical Course 30

Global Flood Risk and Public Health Impact Assessment

Advanced disaster risk reduction and spatial epidemiology using Sentinel-1 SAR, demographic grids, and environmental health risk modeling.
Global Flood-Prone Regions ~2 hours Advanced
Dataset: COPERNICUS/S1_GRD Sentinel-1 SAR Ground Range Detected (GRD)

📖 Key Terms for Beginners

Before starting, make sure you understand these terms. They appear throughout all code blocks in this course.

TermFull NameWhat it means in simple words
SARSynthetic Aperture RadarAn active microwave sensor capable of penetrating clouds and operating day or night to image Earth surfaces.
BackscatterRadar Backscatter CoefficientThe proportion of microwave signal reflected back to the radar antenna, which drops significantly over smooth water surfaces.
VV PolarizationVertical Send, Vertical Receive PolarizationA radar transmission mode sensitive to surface roughness, making it effective for detecting open surface water.
Speckle NoiseGranular Radar Speckle NoiseA salt-and-pepper noise inherent to coherent radar systems that must be smoothed using spatial filtering.
Change DetectionBi-Temporal Change DetectionA method comparing pre-disaster and post-disaster imagery to isolate altered surface conditions such as flooding.
Permanent Water MaskBaseline Hydrological Surface MaskA spatial layer used to exclude regular lakes and rivers from newly inundated flood extent calculations.
Population ExposureSpatial Demographic VulnerabilityThe quantified count of people living within spatial boundaries directly impacted by environmental hazards.
Environmental DeterminantEnvironmental Determinant of HealthPhysical surroundings, such as floodwaters or standing moisture, that elevate exposure risk to infectious diseases.
Waterborne Disease Risk ProxySpatial Risk Proxy for Waterborne PathogensAn estimated risk index derived from inundated area proximity and human population density.
HANDHeight Above Nearest DrainageA topographic normalized elevation model used to evaluate flood susceptibility relative to stream networks.
Spatial AutocorrelationTobler Spatial AutocorrelationThe statistical property where geographic features close to each other exhibit similar environmental risk values.
Ecological FallacySpatial Aggregation FallacyAn error in inference where individual-level health outcomes are assumed based solely on aggregated spatial data.

Contents

  1. 1. Introduction to Radar-Based Flood Mapping and Health Risks
  2. 2. Satellite Datasets for Spatial Epidemiology
  3. 3. Geographic and Temporal Study Region Definition
  4. 4. Sentinel-1 Pre-Processing and Speckle Filtering
  5. 5. Baseline Surface Water Masking with JRC
  6. 6. Bi-Temporal Inundation Extraction Workflow
  7. 7. Topographic Slope Filtering via SRTM DEM
  8. 8. Integrating Demographic Data from WorldPop
  9. 9. Modeling Spatial Vulnerability and Health Exposure
  10. 10. Export, Reproducibility, and Ethical Health Mapping
1
Introduction
10 min

Flooding events severely disrupt communities worldwide, contaminating water supplies and triggering outbreaks of waterborne and vector-borne diseases. Remote sensing using Synthetic Aperture Radar (SAR) provides cloud-free imagery to accurately map surface inundation across global flood-prone regions. By integrating Sentinel-1 SAR flood mapping with high-resolution population datasets, this course demonstrates how spatial data science can quantify human exposure and construct spatial health vulnerability proxies during major disaster events.

GEE Asset ID
COPERNICUS/S1_GRD
Dataset Name
Sentinel-1 SAR Ground Range Detected (GRD)
Study Area
Global Flood-Prone Regions
AI Tool
DeepSeek (free, no API key needed)
🌍
What you will build: By the end of this course you will have a working GEE script that analyzes Global Flood Risk and Public Health Impact Assessment, computes statistics, visualizes results on an interactive map, and exports data to Google Drive.

2
Setup: GEE + DeepSeek
5 min

You need two browser tabs open side by side throughout this course.

1
Open chat.deepseek.com -- free account, no API key needed
2
Open code.earthengine.google.com in a second tab
3
Create a new GEE script named Course30_Global Flood Risk and Public Health Impact Assessment
💡
Workflow: Write a prompt in DeepSeek describing your task with exact dataset IDs and requirements. Copy the generated GEE JavaScript. Paste into GEE code editor. Click Run. Inspect results. Iterate.

3
Crafting the DeepSeek Prompt
15 min

The prompt is the core skill of this course. A good prompt includes the exact dataset ID, band names, study area coordinates, dates, preprocessing steps, and desired outputs.

📋 Main Prompt -- copy and paste this into DeepSeek
Act as an expert GeoAI remote sensing developer. Write a production-grade Google Earth Engine JavaScript script for flood risk and public health impact assessment in Sylhet, Bangladesh (June 2022 severe flood). Use Sentinel-1 SAR GRD ('COPERNICUS/S1_GRD') in VV polarization. Filter pre-flood (May 2022) and post-flood (June 2022) imagery, apply a focal mean speckle filter, calculate backscatter difference, and apply a threshold (-3.5 dB) to identify inundated areas. Mask permanent surface water using 'JRC/GSW1_4/GlobalSurfaceWater' (occurrence > 80%) and terrain slope > 5 degrees using 'USGS/SRTMGL1_003'. Integrate 'WorldPop/GP/100m/pop' (2020) to compute the total exposed population. Calculate a composite spatial health exposure risk index (0 to 1 scale) based on flood proximity and population density. Include visualization layers for pre-flood SAR, post-flood SAR, flood extent, exposed population, and health risk index. Provide code for exporting the flood raster and risk summary statistics to Drive.
✨
After pasting the prompt: Wait 20-30 seconds for DeepSeek to generate the full GEE script. Copy the entire code block it produces. If the output is cut short, type "Continue the code" to get the rest.

4
Sentinel-1 SAR Flood Extraction and Water Masking
10 min

Paste the following code into your GEE code editor and click Run. Read the beginner notes below to understand what each line does.

Sentinel-1 SAR Flood Extraction and Water Masking
// 1. Define Geographic ROI (Sylhet Division, Bangladesh)
var roi = ee.Geometry.Polygon([
  [[91.30, 24.30], [92.50, 24.30], [92.50, 25.20], [91.30, 25.20]]
]);
Map.centerObject(roi, 9);
Map.setOptions('HYBRID');

// 2. Load Sentinel-1 SAR Collection (VV Polarization, IW mode)
var s1 = ee.ImageCollection('COPERNICUS/S1_GRD')
  .filterBounds(roi)
  .filter(ee.Filter.eq('instrumentMode', 'IW'))
  .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))
  .select('VV');

// 3. Define Temporal Windows (Pre-Flood vs Post-Flood 2022)
var preFlood = s1.filterDate('2022-04-15', '2022-05-15').mean().clip(roi);
var postFlood = s1.filterDate('2022-06-15', '2022-06-30').mean().clip(roi);

// 4. Speckle Filtering (3x3 Focal Mean)
var preFiltered = preFlood.focal_mean(30, 'circle', 'meters');
var postFiltered = postFlood.focal_mean(30, 'circle', 'meters');

// 5. Compute Inundation via Change Detection (Ratio/Difference)
var difference = postFiltered.subtract(preFiltered);
var floodThreshold = -3.5;
var rawFlood = difference.lt(floodThreshold);

// 6. Mask Permanent Water & Steep Slopes
var jrcWater = ee.Image('JRC/GSW1_4/GlobalSurfaceWater').select('occurrence');
var permanentWater = jrcWater.gt(80);

var srtm = ee.Image('USGS/SRTMGL1_003');
var slope = ee.Terrain.slope(srtm);
var steepTerrain = slope.gt(5);

var confirmedFlood = rawFlood.where(permanentWater, 0).where(steepTerrain, 0).selfMask();

// 7. Visualization
Map.addLayer(preFiltered, {min: -25, max: 0}, 'Pre-Flood Sentinel-1 (VV)', false);
Map.addLayer(postFiltered, {min: -25, max: 0}, 'Post-Flood Sentinel-1 (VV)', false);
Map.addLayer(confirmedFlood, {palette: ['darkblue']}, 'Extracted Flood Extent');
🔑
Beginner note: This script defines a study area in Sylhet, Bangladesh, during the catastrophic June 2022 flood event. It loads Sentinel-1 SAR imagery in VV polarization, applies spatial filtering to suppress speckle noise, and identifies flooded areas where backscatter dropped by more than 3.5 dB. It then removes permanent water bodies using JRC Global Surface Water and excludes steep terrain using SRTM elevation data.

5
Population Exposure Assessment and Health Risk Modeling
10 min

Add this block after the previous code. It continues the analysis with additional processing and visualization.

Population Exposure Assessment and Health Risk Modeling
// 8. Load WorldPop Data (2020 Population Count)
var worldPop = ee.ImageCollection('WorldPop/GP/100m/pop')
  .filterBounds(roi)
  .filter(ee.Filter.eq('year', 2020))
  .mosaic()
  .clip(roi);

// 9. Calculate Exposed Population Density
var exposedPop = worldPop.updateMask(confirmedFlood);

// 10. Spatial Health Risk Proxy (Distance to Flood + Population Density)
// Proximity to standing floodwater increases waterborne risk exposure
var floodDistance = confirmedFlood.fastDistanceTransform(500).sqrt().multiply(30); // in meters
var proximityScore = ee.Image(1).subtract(floodDistance.divide(5000)).clamp(0, 1);

// Normalize Population Density (0-1 scale)
var popMax = 500; // threshold for high density per cell
var popScore = worldPop.divide(popMax).clamp(0, 1);

// Composite Risk Index = Proximity Weight (0.6) + Density Weight (0.4)
var healthRiskIndex = proximityScore.multiply(0.6).add(popScore.multiply(0.4)).updateMask(popScore.gt(0.01));

// 11. Compute Total Exposed Population Metric
var stats = exposedPop.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: roi,
  scale: 100,
  maxPixels: 1e9
});

print('Estimated Total Population Exposed to Inundation:', stats.get('population'));

// 12. Visualization of Vulnerability & Risk
Map.addLayer(worldPop, {min: 0, max: 200, palette: ['white', 'yellow', 'orange', 'red']}, 'WorldPop Population', false);
Map.addLayer(exposedPop, {min: 0, max: 100, palette: ['purple', 'magenta']}, 'Exposed Population');
Map.addLayer(healthRiskIndex, {min: 0.2, max: 1.0, palette: ['blue', 'cyan', 'yellow', 'orange', 'red']}, 'Health Risk Exposure Index');
🔑
Beginner note: This block integrates 100-meter resolution WorldPop dataset with the extracted flood layer. It calculates the population residing inside flooded areas and models a spatial health risk exposure index. The risk model balances spatial proximity to standing floodwaters (a proxy for water contamination and vector breeding risk) with local population density.

6
Export Results to Google Drive
5 min

Add this block at the end of your script to export the final map as a GeoTIFF to your Google Drive. After clicking Run, go to the Tasks tab in GEE and click Run next to each export task.

Export to Google Drive
// Export Flooded Area and Health Exposure Risk Map to Google Drive
Export.image.toDrive({
  image: healthRiskIndex.toFloat(),
  description: 'Sylhet_Flood_Health_Risk_2022',
  folder: 'GEE_Health_Disasters',
  fileNamePrefix: 'Sylhet_Health_Risk_Index_2022',
  region: roi,
  scale: 100,
  crs: 'EPSG:4326',
  maxPixels: 1e9
});

// Export Inundation Mask Raster
Export.image.toDrive({
  image: confirmedFlood.toByte(),
  description: 'Sylhet_Flood_Extent_2022',
  folder: 'GEE_Health_Disasters',
  fileNamePrefix: 'Sylhet_Inundation_Mask_2022',
  region: roi,
  scale: 30,
  crs: 'EPSG:4326',
  maxPixels: 1e9
});
🔑
Beginner note -- Export.image.toDrive(): This function does not export immediately. It creates a task in the GEE Tasks tab that you must manually start by clicking Run. The file will appear in your Google Drive folder (GEE_Courses) as a GeoTIFF that you can open in QGIS or ArcGIS.

7
Exercises Using DeepSeek Prompts
Homework

Use DeepSeek to extend the script for each exercise below. Write a follow-up prompt describing what you want to add, then copy the generated code and paste it into your GEE script.

Threshold Sensitivity Calibration

  1. Modify the backscatter change threshold from -3.5 dB to -2.0 dB and -5.0 dB in Code Block 1.
  2. Compare the resulting flood surface area variations across urban and rural zones.
  3. Document how threshold sensitivity influences overestimation or underestimation of human health risk.

Seasonal Water Mask Customization

  1. Replace the permanent water mask threshold with dynamic seasonal surface water occurrences (e.g., occurrence > 50%).
  2. Observe changes in extracted flood extent around seasonal wetlands.
  3. Analyze how seasonal water dynamics affect public health exposure estimates.

Health Risk Weighting Experiment

  1. Adjust the composite health risk index weights in Code Block 2 (e.g., 0.8 proximity / 0.2 population).
  2. Generate risk distribution maps for both weight configurations.
  3. Identify high-risk hotspots requiring rapid emergency sanitation deployment.

Administrative Risk Aggregation

  1. Import administrative boundary polygons (e.g., FAO GAUL level 2 boundaries) into GEE.
  2. Apply reduceRegions to aggregate exposed population counts per administrative district.
  3. Export the aggregated summary table as a CSV file to drive evidence-based health policy.

8
Prompt Engineering Tips
Reference

To get the best results from DeepSeek for GEE tasks, always include these elements in your prompts:

ElementExample
Exact dataset IDCOPERNICUS/S1_GRD
Band names"select band 'B4' for red, 'B8' for NIR"
Study area"rectangle [-6.5, 33.0, -1.5, 36.0] North Morocco"
Date range"filter from 2020-01-01 to 2023-12-31"
Output format"print area in hectares, add a legend, export to Drive"
Error fixing"The code gives error X. Please fix it."
Iteration"Add a time series chart for each year 2018-2023"
🧠
Best practice: Start with the main prompt, run the code, then send follow-up prompts to add features one at a time. This gives you cleaner, more reliable code than asking for everything at once.
Course 30 - Global Flood Risk and Public Health Impact Assessment | GeoAI for Climate Change | Dr. Ayoub Lahlouh | UM6P/CUS | 2025/2026