Cartographie reproductible des équipements sportifs du continent africain via OpenStreetMap. Pipeline : pbf/osmium, données, cartes Folium et site GitHub Pages.
# sports-facilities-africa-osm
Technical repository for an open, reproducible pipeline that turns OpenStreetMap
into a dataset of **sports facilities across the African continent**, then maps and
analyzes it.
> 📄 **Preprint:** *Construire les données manquantes à l'échelle continentale : une
> méthode reproductible à partir d'OpenStreetMap* — Benoît Prieur (2026), Zenodo.
>
doi.org
At continental scale, few domains have an open, homogeneous and comparable dataset.
There is none for African sports infrastructure, so this repo builds one from OSM
(imperfect, non-representative, but open and *re-runnable*) and publishes the analysis
as a static site.
- 🌍 **Site:**
thepriben.github.io
- 📄 **Preprint:**
doi.org
- 🗓️ **Data snapshot:** Geofabrik *Africa* extract; see `SNAPSHOT_DATE` in `scripts/common.py`
> **Dataset at a glance** (snapshot 2026-06-15): **123,936** geolocated sports sites ·
> **194** distinct sport tags · 61,679 football pitches. Figures are regenerated by
> the pipeline (see `data/sport_counts.csv` and `docs/data/sport_counts.json`).
---
## Pipeline
```
Geofabrik africa-latest.osm.pbf
│ osmium tags-filter (leisure=pitch | leisure=stadium | building=stadium)
▼
filtered.osm.pbf
│ osmium export -f geojsonseq → shapely (geometry → WKT)
▼
data/sports_facilities.csv (geometry WKT, sport) ← raw, kept intact
│ explode ";" + normalize tags (scripts/common.py)
├─► data/sport_counts.csv (sport, count)
├─► docs/data/sport_counts.json (top N + totals, for the site)
└─► docs/maps/*.html (Folium maps)
```
The first stage (download + `osmium`) is encapsulated in
`scripts/refresh_from_geofabrik.py`. Because the
continental extract is ~8 GB, the script downloads it to a temp folder, filters it,
and deletes the `.pbf` afterwards (use `--keep-pbf` to keep it).
## Repository layout
```
.
├── data/
│ ├── sports_facilities. …