Region Builder and geospatial utilities for working with World Bank administrative boundaries.
- Interactive Streamlit app to group ADM1 regions and export merged group borders as GeoJSON.
- Utility CLI to filter, plot, merge, and simplify geospatial datasets.
app.py: Streamlit Region Builder UI.utils.py: CLI utilities for plotting, merging, and simplifying boundaries.data_config.yaml: Paths and column settings for datasets.dataset/: Source geospatial data (not tracked here if large).output/: Generated maps and merged datasets.
Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtEdit data_config.yaml to point at your local datasets. By default it expects:
- World Bank admin boundaries (Admin 0 and Admin 1) in
dataset/wb_admin_boundaries/ - Natural Earth cities in
dataset/ne_10m_populated_places_simple/
streamlit run app.py# Static map for a region or country
python utils.py static --region AFR --filter kenya uganda
# Interactive map (opens in browser)
python utils.py interactive --region SAR
# Merge CSV attributes into a GPKG
python utils.py merge
# Simplify geometries
python utils.py simplify dataset/wb_admin_boundaries/World\ Bank\ Official\ Boundaries\ -\ Admin\ 1.gpkg --tolerance 0.01Generated maps and merged datasets are written to output/ by default.
data_config.yamlcontrols default layers, merge keys, and label columns.- The Streamlit app uses ADM1 boundaries and assigns regions to user-defined groups.