This repository contains the code, data pipelines, and report on our findings for a spatial analysis of urban heat island effect between Rotterdam (Netherlands) and Guangzhou (China).
The project investigates the intersection of urban morphology (Local Climate Zones - LCZ), thermal environments (Land Surface Temperature - LST), vegetation (NDVI), and potential for street network use (Space Syntax), alongside some secondary metrics. A combination of quantitative (data processing and clustering) and qualitative (interpreting the clustering outcome and suggestion of appropriate nature-based solutions) methods are utilised to perform the analysis.
code/: Contains all data acquisition, processing, and visualization scripts (Python & R).components/: Contains allHTMLfiles embedded within the Quarto document.data/: acts as the storage for Earth Engine tile downloads, rasters, and enriched GeoPackages. Some data (in particularrotterdam/wijkenbuurten_2024.gpkg) may be missing from the repository and needs to be downloaded from https://surfdrive.surf.nl/s/aqgEpftfT7bXpX4?dir=/group-d/data.out/maps/: Directory for exported publication-ready maps generated by the R scripts.qgis-project/: QGIS workspace files, primarily used for manual Place Syntax Tool (PST) network analysis.Report data/: Datasets and assets specifically formatted or isolated for the Quarto reports.report.qmd&report.html: Quarto markdown file and resulting compiled HTML for the report.asa2025-report.Rproj: RStudio project file for managing relative paths and environments.
To run the scripts in this repository, you will need both a Python and an R environment set up.
The Earth Engine, spatial data processing, and machine learning scripts require Python 3.x. You can install all required packages using pip:
pip install earthengine-api geemap geopandas rasterio rasterstats osmnx shapely numpy pandas fiona tqdm scikit-learn requests joblibThe mapping and visualization scripts require R. Open your R console or RStudio and run the following to install the necessary packages:
install.packages(c("sf", "tidyverse", "ggplot2", "viridis", "scales"))- QGIS (3.x): Required for manual network processing.
- Place Syntax Tool (PST): A QGIS plugin required to perform the network betweenness calculations, available at https://github.com/SMoG-Chalmers/PST, and documentation available at https://research.chalmers.se/en/publication/535711.
The project follows a sequential pipeline applied to both Rotterdam and Guangzhou. Note that for Guangzhou, there are 2 separate .ipynb notebooks: one for neighbourhoods (code/guagnzhou.ipynb) and one for the street network in the city centre (code/guangzhou-centre.ipynb), as these are processed independently at different scales. We advise running code/guangzhou-centre.ipynb first.
- Data Acquisition (Earth Engine & OSM)
- Multispectral satellite imagery is fetched via the Earth Engine API, calculating normalized LST and NDVI medians across the 2023–2025 summer months.
- WUDAPT Local Climate Zone (LCZ) global maps are clipped to the Areas of Interest (AOIs).
- Administrative boundaries and walking street networks are extracted via OpenStreetMap.
- Network Analysis (Manual QGIS Step)
- Street networks are exported to GeoPackage format.
- Before proceeding, calculate Network Betweenness using PST pluging in QGIS, using 1000m walking radius and disabling normalisation
- Spatial Enrichment & Zonal Statistics
- Python scripts calculate the mean raster values (LST, NDVI) "under the line" for street segments and extract the LCZ class at starting nodes.
- Neighborhood polygons (Buurten/Subdistricts) are enriched with dominant LCZ classes and road cluster distributions.
- Unsupervised Machine Learning
scikit-learn's MiniBatchKMeans is used to cluster street segments into 6 distinct spatial typologies based on their thermal, NDVI, and network characteristics.
- Visualization & Reporting
- R scripts generate maps used in the report.
- Findings are compiled into Quarto reports.
- Environment Setup: Install all the prerequsites mentioned in the dependencies or the code files itself.
- Earth Engine Authentication: Run the first cell of either Jupyter notebook. You will be prompted to authenticate your Google account to use the Earth Engine API.
- Generate Rasters & Raw Networks: Execute
Code/rotterdam.ipynbandCode/guangzhou.ipynbup to the QGIS intervention warning. - Process Space Syntax:
- Open QGIS.
- Upload the generated street edges.
- Run "Split with lines" and "Multipart to singleparts".
- Use the PST plugin to create a segment map and perform Network Betweenness (walking distance, 1000m radius).
- Save the output exactly as specified in the notebooks (e.g.,
rotterdam_roads_PST.gpkg).
- Run Clustering & Zonal Stats: Resume the Jupyter notebooks to perform the K-Means clustering and aggregate the statistics into the neighborhood boundaries.
- Generate Maps: Run
Code/rotterdam-maps.RandCode/guangzhou-maps.Rto output the final PNG maps toout/maps/. - Compile Report: Render the
.qmdfile using Quarto to generate the final HTML report.