A geospatial pipeline that scores ~71,000 grid cells in Turkana County, Kenya, and recommends one of three electrification pathways (grid extension, solar mini-grid, or off-grid solar) for each cell.
Extending the national grid to remote, low-density areas is expensive, and in many rural parts of Kenya a mini-grid or standalone solar system reaches people faster and at lower cost than a grid connection. Choosing between these options at scale is a spatial problem: the right answer depends on local population, existing infrastructure, distance to the grid, and solar resource. Helios combines several public raster and vector layers, scores each cell of a fine grid, and assigns a recommended pathway with a rough cost and impact estimate so the trade-offs can be compared on a map.
- Loads and harmonizes multiple raster and vector datasets to a common CRS and extent.
- Builds a regular ~1 km grid over the study county (Turkana) and clips it to the county boundary.
- Computes zonal statistics (mean population, nighttime lights, solar potential) for every grid cell.
- Computes distance from each cell to the nearest road, school, and health facility.
- Classifies each cell into grid extension, solar mini-grid, off-grid solar, or unpopulated, and attaches an urgency score, an estimated cost, and an impact estimate.
- Exports a model-ready table and a GeoJSON of recommendations, and renders an interactive Folium map of the results.
Study area and grid. The pipeline targets Turkana County. It generates a regular grid at roughly 1 km spacing (0.01 degree cells in EPSG:4326), clips it to the county boundary, and works with each cell's centroid for distance calculations. The final recommendation layer in the notebook contains 71,287 cells.
Data layers. Per-cell features are drawn from:
- Population density raster (
ken_general_2020.tif), used for mean population per cell. - VIIRS nighttime lights (monthly average radiance), used as a proxy for existing electrification.
- Solar potential from the Global Solar Atlas (PVOUT layer).
- SRTM elevation tiles (merged) and ESA WorldCover land cover, used in the harmonization and terrain context.
- OpenStreetMap roads, plus schools and health facilities, used for distance-to-infrastructure features.
- IEBC administrative boundaries (national and county) for clipping and the study-area definition.
Zonal statistics and distances. Raster layers are clipped to the target boundary with rasterio.mask, and rasterstats.zonal_stats computes the mean of each raster within every cell. Distances to the nearest road, school, and clinic are computed from each cell centroid against the clipped vector layers. Large national rasters are reprojected and clipped in windowed chunks to stay within memory limits before the per-county analysis.
Decision logic. Each cell is classified into one of four categories: grid extension, solar mini-grid, off-grid solar, or unpopulated. The classification uses the per-cell features above (for example, cells with effectively no population are marked unpopulated; the remaining cells are separated by population, distance to existing grid/road infrastructure, and nighttime-lights signal). Each populated cell also receives a normalized urgency score and a short justification string.
Cost and impact estimation. Alongside the recommendation, each cell carries an estimated cost and an impact figure expressed as people served per USD 1,000. These are heuristic estimates intended for relative comparison between cells and pathways, not engineering or budget figures.
Interactive mapping. The recommendations GeoJSON is rendered with Folium: each cell is colored by its recommended pathway, a tooltip shows the recommendation, justification, population, urgency score, estimated cost, and impact, and a population heatmap layer plus a layer-control toggle are added. The map is centered on Turkana and saved as a standalone HTML file.
The pipeline's main output is an interactive map of Turkana County in which every ~1 km cell is colored by its recommended electrification pathway (grid extension, solar mini-grid, off-grid solar, or unpopulated), with per-cell cost, impact, and justification available on hover. Running the notebook writes this map to turkana_interactive_map.html, a single clickable file you can open in any browser; it is not exported to a static image, so it is not shown here.
The static figure below is the study-area boundary used as a sanity check during processing, included for context rather than as the decision output:
Open the notebook with the badge above and run the cells top to bottom. The notebook installs the geospatial stack with pip and reads data from a Google Drive folder, so you will need to point the paths at your own copy of the input datasets (see Data).
The geospatial stack (geopandas, rasterio, fiona, and the underlying GDAL/GEOS/PROJ libraries) is usually easiest to install with conda, which provides matching binary builds. A conda-based setup is recommended over plain pip for local use.
git clone https://github.com/iteba15/helios-energy-access.git
cd helios-energy-access
# Recommended: conda for the geospatial dependencies
conda create -n helios python=3.12
conda activate helios
conda install -c conda-forge geopandas rasterio rioxarray rasterstats folium shapely pyproj fiona contextily matplotlib numpy pandas tqdm
# Or, with pip (GDAL/GEOS/PROJ must be available on your system):
pip install -r requirements.txt
jupyter notebook Helios.ipynbThe notebook's data-loading cells use Google Drive paths from the original Colab run. To run locally, adjust those paths to wherever you place the input files.
- Python (Jupyter notebook)
- geopandas, shapely, pyproj, fiona for vector data and geometry
- rasterio, rioxarray for raster I/O, reprojection, and clipping
- rasterstats for zonal statistics
- folium for the interactive map
- contextily, matplotlib for static plotting and basemaps
- numpy, pandas, tqdm for data handling and progress reporting
The analysis uses the following public datasets. None of the data files are included in this repository; you must download them yourself and update the paths in the notebook.
- Population density raster for Kenya (
ken_general_2020.tif, a high-resolution settlement/population product). - VIIRS nighttime lights monthly average radiance (NOAA/Colorado School of Mines).
- Global Solar Atlas v2 (PVOUT / solar photovoltaic output layer).
- SRTM elevation tiles.
- ESA WorldCover 10 m land cover.
- OpenStreetMap roads and points of interest (schools, health facilities) for Kenya.
- IEBC administrative boundaries (national and county shapefiles, 2019).
This is a prototype decision-support tool, not an official electrification planning instrument.
- The scoring and classification weights are heuristic and were set for exploration, not calibrated against field outcomes.
- Cost and impact figures are rough relative estimates, not engineering or budget numbers.
- Results cover Turkana County only and depend on the resolution and accuracy of the input layers.
- Input data paths in the notebook reflect the original Colab/Google Drive run and need adjusting for any other environment.
Treat the outputs as a starting point for discussion and further analysis, not as a basis for investment decisions.
Allan Kiplagat Iteba, final-year BSc Astrophysics & Space Science, University of Nairobi (UoN).
- GitHub: @iteba15
- LinkedIn: Allan Kiplagat Iteba (link to be added)
- ResearchGate: Allan Kiplagat Iteba (link to be added)
Released under the MIT License. Copyright (c) 2026 Allan Kiplagat Iteba.
