Before starting, make sure you understand these terms. They appear throughout all code blocks in this course.
| Term | Full Name | What it means in simple words |
|---|---|---|
| UHI | Urban Heat Island | A phenomenon where urban areas experience significantly higher temperatures than surrounding rural regions due to human activities and built infrastructure. |
| NO2 | Nitrogen Dioxide | A major atmospheric pollutant emitted primarily by traffic and power plants, serving as a proxy for urban air pollution exposure. |
| LST | Land Surface Temperature | The radiative surface temperature of the ground derived from thermal infrared satellite sensors. |
| MAUP | Modifiable Areal Unit Problem | A statistical bias that occurs when point-based spatial data are aggregated into administrative units of varying shape or scale. |
| Environmental Exposure | Environmental Exposure Assessment | The measurement or estimation of human contact with environmental stressors such as extreme heat, air pollution, or noise. |
| Spatial Autocorrelation | Spatial Autocorrelation | The formal property where geographic features close in space tend to share similar values or characteristics. |
| GHSL | Global Human Settlement Layer | A global spatial dataset mapping built-up intensity and human presence using satellite imagery and demographic data. |
| Syndromic Surveillance | Syndromic Surveillance | The monitoring of health-related data prior to formal clinical diagnosis to detect potential disease outbreaks early. |
| Spatial Confounding | Spatial Confounding | A scenario in spatial regression where unobserved spatially structured variables distort the estimated relationship between predictors and health outcomes. |
| Ecological Fallacy | Ecological Fallacy | A logical error in interpreting statistical data where inferences about individuals are incorrectly deduced from group-level aggregated data. |
| Random Forest Regression | Random Forest Regression | An ensemble machine learning method that constructs multiple decision trees during training to predict continuous spatial environmental metrics. |
| Vulnerability Index | Environmental Health Vulnerability Index | A composite metric integrating exposure, sensitivity, and adaptive capacity to assess population risk to environmental hazards. |
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.
COPERNICUS/S5P/OFFL/L3_NO2You need two browser tabs open side by side throughout this course.
Course24_Urban Health Surveillance with Environmental and Geospatial Data
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.
Paste the following code into your GEE code editor and click Run. Read the beginner notes below to understand what each line does.
// 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');
Add this block after the previous code. It continues the analysis with additional processing and visualization.
// 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');
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 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'
});
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.
To get the best results from DeepSeek for GEE tasks, always include these elements in your prompts:
| Element | Example |
|---|---|
| Exact dataset ID | COPERNICUS/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" |