Practical Course 27

Healthcare Accessibility Mapping with GIS and AI in Sub-Saharan Africa

Analyze population distribution and physical access to health facilities across Sub-Saharan Africa using Google Earth Engine and spatial accessibility models.
Sub-Saharan Africa ~2 hours Intermediate
Dataset: WorldPop/GP/100m/pop WorldPop Unadjusted Population Count

📖 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
Spatial AccessibilitySpatial Accessibility MetricA measure of how easily populations in a given spatial location can reach physical healthcare services given distance, travel friction, and infrastructure.
Friction SurfaceTravel Time Friction Surface GridA spatial raster layer representing the time required to cross each pixel based on road networks, terrain elevation, land cover, and travel mode.
WorldPopWorldPop High Resolution Population GridsA global spatial dataset offering high-resolution estimates of human population distribution at 100-meter grid resolution.
Distance DecayDistance Decay FunctionA geographic principle stating that service utilization decreases continuously as geographic distance or travel time to the facility increases.
E2SFCAEnhanced Two-Step Floating Catchment Area MethodA spatial accessibility modelling approach that accounts for both supply capacity of facilities and demand competition from surrounding populations.
Health EquityGeographic Health Equity IndicatorThe principle that access to vital health infrastructure should be equally distributed regardless of geographical location or socio-economic isolation.
Catchment AreaHealthcare Facility Catchment ZoneThe geographic region from which a primary clinic or hospital draws its patient population based on physical proximity or administrative boundaries.
MAUPModifiable Areal Unit ProblemA statistical bias where spatial analysis outcomes change based on how geographic boundaries and aggregation units are defined.
Travel Time CostIsochrone Travel BurdenThe total duration in minutes required for an individual to travel from a specific home location to the nearest functioning facility.
Spatial AutocorrelationSpatial Dependence MeasureThe degree to which nearby locations display similar values of healthcare accessibility or health service deficits.
GeoAIGeospatial Artificial IntelligenceThe integration of spatial analytics, machine learning, and high-performance cloud computing to address spatial public health problems.
Demographic VulnerabilityPopulation Vulnerability IndexAn assessment of sensitive population cohorts, such as children and elderly, living in areas with severe healthcare travel barriers.

Contents

  1. 1. Introduction to Healthcare Geography and Accessibility
  2. 2. Geographic Context and Health Disparities in Sub-Saharan Africa
  3. 3. Gridded Population and Friction Surface Datasets
  4. 4. Defining the Study Region and Spatial Filtering
  5. 5. Preprocessing WorldPop and Oxford MAP Friction Surfaces
  6. 6. Travel Time and Isochrone Modeling in Google Earth Engine
  7. 7. Calculating Population-Weighted Health Accessibility Deficits
  8. 8. Identifying Vulnerable and Underserved Population Clusters
  9. 9. Policy Applications and Health Spatial Analytics
  10. 10. Methodological Limitations, Data Privacy, and Ethics
1
Introduction
10 min

Equal access to medical care remains a pivotal public health challenge across Sub-Saharan Africa, where physical distance and transportation barriers severely impede timely treatment. This course teaches how to combine high-resolution gridded population datasets from WorldPop with travel friction surfaces from the Malaria Atlas Project inside Google Earth Engine. Students will learn to map travel costs, identify vulnerable rural populations living outside standard healthcare catchment zones, and quantify spatial equity metrics for evidence-based health policy.

GEE Asset ID
WorldPop/GP/100m/pop
Dataset Name
WorldPop Unadjusted Population Count
Study Area
Sub-Saharan Africa
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 Healthcare Accessibility Mapping with GIS and AI in Sub-Saharan Africa, 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 Course27_Healthcare Accessibility Mapping with GIS and AI in Sub-Saharan Africa
💡
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 a GeoAI and public health GIS expert. Write a complete, executable Google Earth Engine JavaScript script focusing on Kenya in Sub-Saharan Africa. Load WorldPop population data ('WorldPop/GP/100m/pop' for 2020) and Oxford MAP accessibility to cities ('Oxford/MAP/accessibility_to_cities_2015_v1_0'). Filter both datasets to Kenya geometry using FAO GAUL boundaries ('FAO/GAUL/2015/level0'). Mask population values below 1. Mask accessibility values where travel time is valid. Compute an indicator of underserved population defined as pixels with population density > 50 people per 100m grid cell and travel time to urban care centres > 120 minutes. Color-code the accessibility raster using a spectral palette and overlay the highlighted underserved population mask in bright red. Add a clear legend, map labels, and compute total underserved population using reduceRegion sum. Provide thorough line-by-line comments explaining the public health implications.
✨
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
Data Loading, Spatial Filtering, and Travel Friction Visualization
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.

Data Loading, Spatial Filtering, and Travel Friction Visualization
// 1. Define Spatial Scope: Country boundary for Kenya in Sub-Saharan Africa
var countries = ee.FeatureCollection('FAO/GAUL/2015/level0');
var kenya = countries.filter(ee.Filter.eq('ADM0_NAME', 'Kenya'));
var roi = kenya.geometry();

// 2. Load WorldPop 2020 Population Count Data
var worldpop = ee.ImageCollection('WorldPop/GP/100m/pop')
  .filter(ee.Filter.eq('year', 2020))
  .select('population')
  .mosaic()
  .clip(roi);

// 3. Load Oxford MAP Travel Time to Cities (2015)
var travelTime = ee.Image('Oxford/MAP/accessibility_to_cities_2015_v1_0')
  .select('accessibility')
  .clip(roi);

// 4. Load SRTM Elevation for topographical context
var elevation = ee.Image('USGS/SRTMTM_003').select('elevation').clip(roi);
var slope = ee.Terrain.slope(elevation);

// 5. Center map display over Kenya
Map.centerObject(kenya, 6);
Map.setOptions('ROADMAP');

// 6. Define visualization parameters for population
var popVis = {
  min: 0.0,
  max: 50.0,
  palette: ['#f7fcf5', '#e0f3f8', '#9ecae1', '#4292c6', '#084594']
};

// 7. Define visualization parameters for travel accessibility (minutes)
var travelVis = {
  min: 0.0,
  max: 300.0,
  palette: ['#1a9850', '#91cf60', '#d9ef8b', '#fee08b', '#fc8d59', '#d73027']
};

// 8. Add layers to the Earth Engine map canvas
Map.addLayer(worldpop, popVis, 'WorldPop Population 2020 (per cell)');
Map.addLayer(travelTime, travelVis, 'Travel Time to Facility/City (Min)');
Map.addLayer(slope, {min: 0, max: 20, palette: ['white', 'black']}, 'Terrain Slope (Degrees)', false);
🔑
Beginner note: This script initializes the study region on Kenya within Sub-Saharan Africa using the official FAO GAUL boundary dataset. It imports 2020 WorldPop grid population counts alongside the Oxford Malaria Atlas Project global accessibility raster. Topographical slope is calculated from SRTM to account for physical landscape constraints. Visualization palettes are applied to display population density in shades of blue and travel times ranging from low (green, high accessibility) to high (red, extreme isolation).

5
Identifying Underserved Populations and Quantifying Access Deficits
10 min

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

Identifying Underserved Populations and Quantifying Access Deficits
// 1. Define criteria for underserved health population
// High population density (> 5 people per 100m grid cell) AND long travel time (> 120 minutes)
var highPopMask = worldpop.gte(5);
var longTravelMask = travelTime.gte(120);

// 2. Combine conditions to extract priority underserved spatial zones
var underservedMask = highPopMask.and(longTravelMask);
var underservedPop = worldpop.updateMask(underservedMask);

// 3. Highlight priority underserved areas in bright red
var underservedVis = {
  palette: ['#ff0000']
};
Map.addLayer(underservedPop, {min: 5, max: 100, palette: ['#ff7800', '#e31a1c', '#800026']}, 'Underserved Population Grid');

// 4. Calculate total estimated population living > 2 hours away from facility nodes
var totalUnderserved = worldpop.updateMask(longTravelMask).reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: roi,
  scale: 100,
  maxPixels: 1e9
});

// 5. Calculate total national population for percentage baseline
var totalPopulation = worldpop.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: roi,
  scale: 100,
  maxPixels: 1e9
});

// 6. Print summary quantitative results to console
print('Total National Estimated Population:', totalPopulation.get('population'));
print('Estimated Population > 2 Hours Travel Time:', totalUnderserved.get('population'));
🔑
Beginner note: This block demonstrates a spatial thresholding workflow to isolate underserved communities. It creates binary masks for pixels meeting two conditions: significant population density and travel time exceeding 120 minutes to primary urban care nodes. The resulting layer isolates high-priority intervention zones. Finally, Earth Engine reducers aggregate the pixel-level population counts to calculate the total estimated population residing in severe healthcare travel isolation across the study area.

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 the underserved population raster to Google Drive for GIS reporting
Export.image.toDrive({
  image: underservedPop.unmask(0),
  description: 'Underserved_Healthcare_Population_Kenya',
  folder: 'GEE_PublicHealth_Exports',
  fileNamePrefix: 'Underserved_Pop_Kenya_2020',
  region: roi,
  scale: 250,
  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.

Adjusting Accessibility Thresholds for Vulnerable Groups

  1. Modify the travel time isolation threshold from 120 minutes to 60 minutes in Code Block 2.
  2. Re-run the script to compute the expanded size of the vulnerable population under the 1-hour access mandate.
  3. Compare the total count of affected citizens between the 1-hour and 2-hour accessibility thresholds.

Subnational Health Disparity Analysis by Administrative Unit

  1. Load FAO GAUL Administrative Level 1 features (Counties/Provinces) for the target country.
  2. Use reduceRegions to compute mean travel time per county or province.
  3. Identify the top three administrative regions suffering from the highest average travel times to healthcare.

Terrain Impact on Access Isolation

  1. Calculate mean slope within the identified underserved geographic zones.
  2. Determine if elevated slope (> 10 degrees) correlates spatially with extended travel isolation.
  3. Document how mountain terrain amplifies healthcare transportation deficits in rural areas.

Exporting Priority Action Maps for Policy Decision-Making

  1. Convert the continuous underserved population map into a GeoTIFF raster file.
  2. Configure export tasks targeting Google Drive at 250-meter spatial scale.
  3. Import the raster into desktop GIS software (e.g. QGIS) to overlay local road network vectors.

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 IDWorldPop/GP/100m/pop
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 27 - Healthcare Accessibility Mapping with GIS and AI in Sub-Saharan Africa | GeoAI for Climate Change | Dr. Ayoub Lahlouh | UM6P/CUS | 2025/2026