Skip to content

WP1.1: Add built-up share (WSF2019) as city characteristic - #10

Merged
FlorianNachtigall merged 1 commit into
mainfrom
simonmontfort-add-wsf-2019-built-ratio
Oct 9, 2026
Merged

FlorianNachtigall merged 1 commit into
mainfrom
simonmontfort-add-wsf-2019-built-ratio

Conversation

@SimonMontfort

@SimonMontfort SimonMontfort commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #9

Summary

Adds built-up share: the share of each urban centre's area covered by settlements in the World Settlement Footprint 2019. It is shown in the explorer like the other city characteristics (value, percentile chip, colour-by, filter).

Data source

  • World Settlement Footprint (WSF) 2019 v1, DLR Earth Observation Center. DOI 10.15489/twg5xsnquw84. 10 m binary settlement mask from 2019 Sentinel-1/-2 imagery, CC-BY-4.0.
    Citation: Marconcini et al. (2021), GI_Forum 1, 33–38, doi:10.1553/giscience2021_01_s33
  • GHS-UCDB R2024A V1-0 (JRC) for the urban centre polygons. The IDs match id in cities.json.

Method (preprocessing/wsf-2019/)

  1. Download polygons (01_download_ucdb.py): GHS-UCDB R2024A V1-0 from the JRC FTP; only ID_UC_G0 + geometry are kept.
  2. Download and intersect (02_compute_wsf_stats.py):
    • Only the WSF tiles that intersect an urban centre are downloaded. Each tile is processed for all cities touching it and deleted straight away.
    • A pixel counts if its centre lies inside the polygon. 255 = built up; 0 = not built up.
    • WSF tiles overlap by 0.1°. Only pixels inside each tile's nominal 2°×2° cell are counted, so cities crossing tile borders are not double counted.
    • Pixel areas are computed per raster row on the sphere, because EPSG:4326 pixels shrink towards the poles.
    • Progress is checkpointed, so an interrupted run resumes.
    • Output: output/wsf_2019_stats.csv, with built share, built:non-built ratio, built and observed km², and pixel counts.
  3. Plots and descriptive statistics (03_plot_and_describe.R):
    • a world map (Robinson) with distributions by region and type;
    • histograms and the relation to population density;
    • output/wsf_2019_descriptive_stats.csv: global, by region and by type, including area-weighted values.
  4. Merge (new last cell in preprocess.ipynb): adds built_up_share and built_up_ratio to characteristics/percentiles in public/cities.json. It runs standalone on the existing cities.json, until the rest of the notebook is refactored, and changes no other values.

All raw data is stored temporarily in preprocessing/wsf-2019/data_raw/ (gitignored) and deleted at the end of run.sh. Only the CSVs and plots in output/ are kept.

Reproduce

See preprocessing/wsf-2019/README.md. In short:

cd preprocessing/wsf-2019
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
Rscript install_packages.R
./run.sh

Then run the last cell of preprocess.ipynb from the repo root.

Frontend

  • src/utils/metrics.js: new metric "Built-up share [%]"
  • src/components/InfoPanel.jsx: WSF2019 attribution (required by CC-BY-4.0)

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

💤 This PR is closed. The preview is no longer maintained.

Last preview URL:
https://ai4up.github.io/cities-learning-explorer/pr-10/

@FlorianNachtigall FlorianNachtigall changed the title add built-up share (WSF2019) as city characteristic WP1.1: Add built-up share (WSF2019) as city characteristic Oct 9, 2026
@FlorianNachtigall
FlorianNachtigall self-requested a review October 9, 2026 09:21
@FlorianNachtigall
FlorianNachtigall merged commit c9e3a32 into main Oct 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WP1.1 Add built-up share (WSF2019) as city characteristic

2 participants