Skip to content

feat: add Population Dynamics Insights custom boundary aggregation guide#53

Merged
matttoon merged 1 commit into
mainfrom
feat/population-dynamics-worldpop
May 8, 2026
Merged

feat: add Population Dynamics Insights custom boundary aggregation guide#53
matttoon merged 1 commit into
mainfrom
feat/population-dynamics-worldpop

Conversation

@henrikvalv3
Copy link
Copy Markdown
Collaborator

Summary

This PR introduces a new notebook demonstrating how to aggregate Population Dynamics Insights (PDI) embeddings into custom, arbitrary boundaries (e.g., retail trade areas, 5km isochrones).

To prevent the spatial distortion caused by naive area-weighted averaging, this guide uses a population-weighted average using the WorldPop 2025 dataset.

Key Features/Notes

  • Uses BigQuery S2_COVERINGCELLIDS and Earth Engine's ST_REGIONSTATS to perform all spatial overlays and population counting.
  • L2 normalization has been decoupled from the SQL pipeline. The BigQuery output retains the raw signal magnitude (volume/density). An optional Scikit-Learn Python step is included to L2 normalize the vectors for downstream algorithms that require unit vectors (e.g., Cosine Similarity, K-Means clustering).
  • Includes a testing cell using NumPy to validate that the resulting embeddings maintain exactly 330 dimensions and (if normalized) a magnitude of ~1.0.
  • Added licensing information and the recommended academic citation for the WorldPop dataset at the bottom of the notebook.

@matttoon matttoon merged commit e4665ed into main May 8, 2026
2 checks passed
@henrikvalv3 henrikvalv3 deleted the feat/population-dynamics-worldpop branch May 8, 2026 12:04
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.

2 participants