Practical Course 24

Urban Health Surveillance with Environmental and Geospatial Data

Analyze urban environmental health risk exposures using multi-sensor satellite imagery and spatial machine learning across global cities.
Global Cities ~2 hours Advanced
Dataset: COPERNICUS/S5P/OFFL/L3_NO2 Sentinel-5P OFFL NO2: Offline Nitrogen Dioxide Column Density

📖 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
UHIUrban Heat IslandA phenomenon where urban areas experience significantly higher temperatures than surrounding rural regions due to human activities and built infrastructure.
NO2Nitrogen DioxideA major atmospheric pollutant emitted primarily by traffic and power plants, serving as a proxy for urban air pollution exposure.
LSTLand Surface TemperatureThe radiative surface temperature of the ground derived from thermal infrared satellite sensors.
MAUPModifiable Areal Unit ProblemA statistical bias that occurs when point-based spatial data are aggregated into administrative units of varying shape or scale.
Environmental ExposureEnvironmental Exposure AssessmentThe measurement or estimation of human contact with environmental stressors such as extreme heat, air pollution, or noise.
Spatial AutocorrelationSpatial AutocorrelationThe formal property where geographic features close in space tend to share similar values or characteristics.
GHSLGlobal Human Settlement LayerA global spatial dataset mapping built-up intensity and human presence using satellite imagery and demographic data.
Syndromic SurveillanceSyndromic SurveillanceThe monitoring of health-related data prior to formal clinical diagnosis to detect potential disease outbreaks early.
Spatial ConfoundingSpatial ConfoundingA scenario in spatial regression where unobserved spatially structured variables distort the estimated relationship between predictors and health outcomes.
Ecological FallacyEcological FallacyA logical error in interpreting statistical data where inferences about individuals are incorrectly deduced from group-level aggregated data.
Random Forest RegressionRandom Forest RegressionAn ensemble machine learning method that constructs multiple decision trees during training to predict continuous spatial environmental metrics.
Vulnerability IndexEnvironmental Health Vulnerability IndexA composite metric integrating exposure, sensitivity, and adaptive capacity to assess population risk to environmental hazards.

Contents

  1. 1. Introduction to Geospatial Urban Health Surveillance
  2. 2. Atmospheric Exposure Modeling with Sentinel-5P NO2
  3. 3. Thermal Risk Assessment via MODIS Land Surface Temperature
  4. 4. Integrating Built Infrastructure Metrics from GHSL
  5. 5. Defining Global Urban Boundaries and Spatial Grids
  6. 6. Multi-Hazard Composite Vulnerability Index Calculation
  7. 7. Machine Learning Predictive Modeling for Health Risk Proxies
  8. 8. Spatial Autocorrelation and Statistical Validation
  9. 9. Ethics, Privacy, and Ecological Fallacy in Spatial Health Data
  10. 10. Exporting Health Surveillance Indicators and Dashboards
1
Introduction
10 min

Rapid urbanization exposes billions of global citizens to environmental stressors including atmospheric pollution and extreme heat events. This course demonstrates how to integrate multi-sensor remote sensing data with spatial machine learning in Google Earth Engine to model health risk exposures across major global cities. Students will build end-to-end urban health surveillance workflows that combine Sentinel-5P NO2 concentrations, MODIS land surface temperatures, and GHSL built-environment indicators while adhering to rigorous epidemiological protocols.

GEE Asset ID
COPERNICUS/S5P/OFFL/L3_NO2
Dataset Name
Sentinel-5P OFFL NO2: Offline Nitrogen Dioxide Column Density
Study Area
Global Cities
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 Urban Health Surveillance with Environmental and Geospatial Data, 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 Course24_Urban Health Surveillance with Environmental and Geospatial Data
💡
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 public health researcher. Write a complete Google Earth Engine JavaScript script that performs urban health surveillance analysis for a global urban region (such as London, Tokyo, or Sao Paulo). Load Sentinel-5P NO2 ('COPERNICUS/S5P/OFFL/L3_NO2', band 'tropospheric_NO2_column_number_density') and MODIS LST ('MODIS/061/MOD11A2', band 'LST_Day_1km'). Convert MODIS LST to Celsius by multiplying by 0.02 and subtracting 273.15. Load GHSL Built-Up surface ('JRC/GHSL/P2023A/GHS_BUILT_S', band 'built_surface'). Filter data for summer 2023. Define a urban boundary using a bounding box or point buffer. Normalize all three bands (NO2, LST, Built-Up) between 0 and 1 using min-max scaling across the region. Combine them into an Urban Vulnerability Index (UVI) image = 0.4*LST_norm + 0.4*NO2_norm + 0.2*Built_norm. Train a Random Forest regressor (ee.Classifier.smileRandomForest) using LST as target and covariates like NO2, elevation (USGS/SRTMGL1_003), and built-up fraction. Display LST, NO2, Built-Up, UVI, and Predicted LST layers. Include clean visualizers and export code for the UVI raster.
✨
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
Multi-Sensor Environmental Exposure Mapping
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.

Multi-Sensor Environmental Exposure Mapping
// Urban Health Surveillance: Multi-Sensor Environmental Exposure Mapping
// Target Region: London Metropolitan Area
var urbanPoint = ee.Geometry.Point([-0.1278, 51.5074]);
var roi = urbanPoint.buffer(25000).bounds();

// Time window for summer season
var startDate = '2023-06-01';
var endDate = '2023-08-31';

// 1. Sentinel-5P Nitrogen Dioxide (NO2) Exposure
var s5p = ee.ImageCollection('COPERNICUS/S5P/OFFL/L3_NO2')
  .filterBounds(roi)
  .filterDate(startDate, endDate)
  .select('tropospheric_NO2_column_number_density');
var meanNO2 = s5p.mean().clip(roi);

// 2. MODIS Land Surface Temperature (LST) Exposure
var modis = ee.ImageCollection('MODIS/061/MOD11A2')
  .filterBounds(roi)
  .filterDate(startDate, endDate)
  .select('LST_Day_1km');

var convertToCelsius = function(img) {
  var celsius = img.multiply(0.02).subtract(273.15);
  return celsius.copyProperties(img, ['system:time_start']);
};
var meanLST = modis.map(convertToCelsius).mean().clip(roi);

// 3. GHSL Built-up Intensity
var ghsl = ee.Image('JRC/GHSL/P2023A/GHS_BUILT_S/2020')
  .select('built_surface')
  .clip(roi);

// Center Map
Map.centerObject(roi, 10);

// Visualization Parameters
var vizNO2 = {min: 0.00003, max: 0.00015, palette: ['blue', 'yellow', 'red']};
var vizLST = {min: 18, max: 35, palette: ['blue', 'green', 'yellow', 'orange', 'red']};
var vizBuilt = {min: 0, max: 100, palette: ['white', 'gray', 'black']};

// Add Layers
Map.addLayer(meanLST, vizLST, 'Land Surface Temp (C)');
Map.addLayer(meanNO2, vizNO2, 'Tropospheric NO2 Density');
Map.addLayer(ghsl, vizBuilt, 'GHSL Built-Up Surface');
🔑
Beginner note: This script defines a 25km buffer around central London and extracts environmental exposure predictors during summer 2023. Tropospheric NO2 column density is derived from Sentinel-5P to quantify air pollution levels. MODIS 8-day LST is converted from Kelvin scale factor values to degrees Celsius to assess urban heat exposure. Finally, GHSL built-up surface intensity is integrated to represent physical infrastructure density.

5
GeoAI Composite Vulnerability Index and Spatial Prediction
10 min

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

GeoAI Composite Vulnerability Index and Spatial Prediction
// Continuation: Min-Max Normalization and GeoAI Modeling

// Helper function for Min-Max Normalization
var normalize = function(img, geometry) {
  var minMax = img.reduceRegion({
    reducer: ee.Reducer.minMax(),
    geometry: geometry,
    scale: 1000,
    maxPixels: 1e9
  });
  var keys = minMax.keys();
  var minVal = ee.Number(minMax.get(keys.get(0)));
  var maxVal = ee.Number(minMax.get(keys.get(1)));
  return img.subtract(minVal).divide(maxVal.subtract(minVal)).rename('normalized');
};

var lstNorm = normalize(meanLST, roi);
var no2Norm = normalize(meanNO2, roi);
var builtNorm = normalize(ghsl, roi);

// Compute Composite Health Vulnerability Index (UVI)
var uvi = lstNorm.multiply(0.4)
  .add(no2Norm.multiply(0.4))
  .add(builtNorm.multiply(0.2))
  .rename('UVI');

// Load Elevation Covariate
var elevation = ee.Image('USGS/SRTMGL1_003').select('elevation').clip(roi);

// Stack features for GeoAI Modeling
var featureStack = meanLST.rename('LST')
  .addBands(meanNO2.rename('NO2'))
  .addBands(ghsl.rename('Built'))
  .addBands(elevation);

// Generate Stratified Random Training Sample
var samples = featureStack.sample({
  region: roi,
  scale: 1000,
  numPixels: 1000,
  geometries: true
});

// Train Random Forest Regressor to predict Thermal Risk (LST)
var rfModel = ee.Classifier.smileRandomForest(50).setOutputMode('REGRESSION');
var trainedModel = rfModel.train({
  features: samples,
  classProperty: 'LST',
  inputProperties: ['NO2', 'Built', 'elevation']
});

var predictedLST = featureStack.classify(trainedModel).rename('Predicted_LST');

// Visualization
var vizUVI = {min: 0, max: 0.8, palette: ['navy', 'cyan', 'lime', 'yellow', 'red']};
Map.addLayer(uvi, vizUVI, 'Urban Health Vulnerability Index (UVI)');
Map.addLayer(predictedLST, vizLST, 'GeoAI Predicted LST');
🔑
Beginner note: This script normalizes atmospheric NO2, land surface temperature, and built-up fraction using min-max scaling to build an Urban Health Vulnerability Index (UVI). Next, SRTM terrain elevation is added as an environmental driver. A Random Forest regression classifier with 50 decision trees is trained on random spatial samples to predict LST based on environmental and structural covariates, demonstrating spatial risk extrapolation.

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 Urban Health Vulnerability Index Raster to Google Drive
Export.image.toDrive({
  image: uvi,
  description: 'Urban_Health_Vulnerability_Index_2023',
  folder: 'GEE_Urban_Health',
  fileNamePrefix: 'UVI_London_2023',
  scale: 1000,
  region: roi,
  maxPixels: 1e9,
  fileFormat: 'GeoTIFF'
});
🔑
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.

Comparative Vulnerability of Multi-City Regions

  1. Change the urban center coordinates from London to another global megacity (e.g., Tokyo, Sao Paulo, or Cairo).
  2. Adjust the time window to target the localized summer season for the chosen city.
  3. Compare the average normalized NO2 vs LST values using reduceRegion summary statistics.

Sensitivity Analysis of Vulnerability Weights

  1. Modify the composite UVI weighting scheme from 0.4/0.4/0.2 to an air quality focused weighting (0.6 NO2, 0.2 LST, 0.2 Built).
  2. Compute difference maps between the baseline UVI and the re-weighted index image.
  3. Identify urban neighborhoods where the vulnerability classification changed significantly.

Feature Importance Assessment in GeoAI Modeling

  1. Include an additional covariate image such as Sentinel-2 NDVI ('COPERNICUS/S2_SR_HARMONIZED') into the featureStack.
  2. Retrain the Random Forest regressor with the updated predictor list.
  3. Print model execution metrics or evaluate feature contribution visually.

Aggregating Exposure Metrics to Health Administration Units

  1. Load a public administrative boundary feature collection (e.g., FAO GAUL level 2 boundaries).
  2. Perform reduceRegions to calculate the mean UVI per administrative boundary unit.
  3. Discuss potential MAUP and ecological fallacy risks when reporting average vulnerability at administrative levels.

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/S5P/OFFL/L3_NO2
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 24 - Urban Health Surveillance with Environmental and Geospatial Data | GeoAI for Climate Change | Dr. Ayoub Lahlouh | UM6P/CUS | 2025/2026