Pipeline to build DR Congo’s administrative hierarchy (and roads) from an OSM
.osm.pbf, store it in Postgres/PostGIS, and mirror it into Neo4j. The goal is
to keep an updated database ready for applications and backend services that
need administrative locations: address validation/lookup, populating select
lists, or any feature that must link entities to a clean admin hierarchy.
- DR Congo OSM extract: https://download.geofabrik.de/africa/congo-democratic-republic-251204.osm.pbf
- OpenStreetMap CD (RDC) on HDX: https://data.humdata.org/organization/osm-rdc
- Upstream data © OpenStreetMap contributors. Big thanks to Claire Halleux for their contributions to OSM DRC: https://wiki.openstreetmap.org/wiki/User:Claire_Halleux.
- Up-to-date DR Congo admin hierarchy, ready for integration in apps/services that need address lookup, validation, and select lists.
- Domain tables for country → province → city/territory → municipality/commune → neighborhood/groupement → locality/village → bloc, with roads anchored to the deepest containing admin unit.
- Exports for Postgres and Neo4j (CSV + SQL) under
dataset/.
- Docker + docker compose
osm2pgsqlinstalled on the host- OSM extract in
data/(default:data/congo-democratic-republic-251204.osm.pbf)
git clone https://github.com/bernard-ng/drc-admin-hierarchy drc-admin-hierarchy
cd drc-admin-hierarchy
# Place your .osm.pbf in data/ or set OSM_FILE when running the import
cp /path/to/your.osm.pbf data/congo-democratic-republic-251204.osm.pbfdocker compose upsettings in.envas needed.make import— load OSM into Postgres.make rebuild— build hierarchy + roads with admin links.make graph— create Neo4j nodes/edges. (Neo4j:http://localhost:7474, Bolt:bolt://localhost:7687.)
Notes:
- Domain table values are trimmed and lowercased.
- Kinshasa is treated as both province and city (province mirrored as city when needed).
.envis read by scripts and compose; adjust for custom ports/credentials.
Processed outputs are stored under dataset/ after running make rebuild and make graph:
| File | Description |
|---|---|
| data_admin.sql | SQL dump of admin hierarchy domain tables (country through bloc). |
| data_osm.sql | SQL dump of raw OSM tables (osm_boundaries, osm_places, osm_roads). |
| admin_nodes.csv | Neo4j-ready nodes for admin hierarchy. |
| admin_edges.csv | Neo4j-ready edges linking admin levels (parent/child). |
| roads.csv | Roads with names/refs and admin anchors. |
| road_admin_edges.csv | Edges between roads and their containing admin units. |
Domain tables align to OSM admin_level values (see https://wiki.openstreetmap.org/wiki/FR:Key:admin_level):
country— level 2province— level 4city(territoire/ville, Kinshasa mirrored) — level 6municipality(collectivité/commune) — level 7neighborhood(groupement/quartier) — level 8locality(localité/village/cellule) — level 9bloc(subdivision interne) — level 10road— not anadmin_level, but each road is anchored to the deepest admin unit it intersects (bloc → country).
