Local Climate Zone classification and temperature extraction workflows for Johannesburg, South Africa.
The repository has two halves. Python scripts at the top level pull temperature data from Google Earth Engine. An R project in johannesburg_lcz_analysis/ classifies Local Climate Zones and produces the urban heat island figures.
| Script | Purpose |
|---|---|
extract_jhb_temperature.py |
ERA5-Land hourly 2 m air temperature over the Johannesburg metropolitan area |
extract_jhb_modis_lst.py |
MODIS land surface temperature, as an alternative to ERA5 |
test_gee_connection.py |
Check Earth Engine authentication before a long extraction |
validate_extracted_data.py |
Quality checks on an extracted CSV |
enable_earth_engine.sh |
Enable the Earth Engine API on a Google Cloud project via gcloud |
pip install -r requirements.txt
earthengine authenticate
python test_gee_connection.py
python extract_jhb_temperature.py
python validate_extracted_data.py johannesburg_temperature_data.csvEach extraction writes a timestamped CSV, a companion _metadata.json recording the dataset, date range and sampling points, and an extraction_log.txt. Output is written next to the scripts, so no paths need editing.
SETUP_GUIDE.md covers Earth Engine registration and troubleshooting. SETUP_INSTRUCTIONS.md is the shorter walkthrough. README_GEE_EXTRACTION.md documents the extraction parameters in full, and QUICK_REFERENCE.md lists the common commands.
johannesburg_lcz_analysis/ holds the classification and mapping pipeline, built on the LCZ4r package. Scripts in scripts/ run in numbered order from environment setup onwards:
| Script | Purpose |
|---|---|
01_setup_environment.R |
Install R dependencies, including LCZ4r from GitHub |
02_acquire_lcz_map.R |
Retrieve the LCZ map for Johannesburg |
03_analyze_urban_parameters.R |
Urban canopy parameters and LCZ area statistics |
04_climate_analysis.R |
UHI intensity and thermal anomalies |
05_spatial_interpolation.R |
Continuous temperature surfaces |
06_presentation_visuals.R |
Figures for presentation |
presentation/demo_workflow.R runs the sequence end to end. Outputs land in outputs/, with PNG and SVG versions of each map plus summary tables of LCZ area statistics and UHI intensity. See johannesburg_lcz_analysis/QUICKSTART.md to run it, MAPS_GUIDE.md for the map catalogue, and DATA_SOURCES.md for observational data provenance. NEXT_STEPS.md at the top level links the two halves together.
| Source | Used for | Notes |
|---|---|---|
ERA5-Land Hourly (ECMWF/ERA5_LAND/HOURLY) |
Hourly 2 m air temperature | ~11 km grid, sampled at 10 points across the urban–rural gradient |
MODIS MOD11A1 / MYD11A1 (collection 061) |
Land surface temperature | 1 km grid, Terra and Aqua, day and night |
| LCZ4r / LCZ Generator | Local Climate Zone map | Either the global dataset or a custom LCZ Generator submission |
| Weather station observations | Validation and interpolation | Not redistributed here; see johannesburg_lcz_analysis/DATA_SOURCES.md for how to obtain SAWS or NOAA ISD data |
Extractions cover the bounding box 27.75–28.35 °E, 26.45–25.95 °S. The committed CSV
(jhb_temperature_era5_20260211_121556.csv, and its copy johannesburg_temperature_data.csv)
is a 30-day ERA5-Land extraction, 10 points, 7 200 hourly records; the exact
parameters are in the accompanying metadata JSON.
johannesburg_lcz_analysis/data/ and the top-level CSVs hold extracted climate data only. No health or participant data belongs in this repository.
Part of heat vulnerability work at the HE²AT Center, Wits Planetary Health Research, supported by NIH award U54 TW 012083.
See CITATION.cff, or use the "Cite this repository" link on GitHub.
MIT, see LICENSE.