Skip to main content

gridfinder

gridfinder uses night-time lights imagery to as an indicator of settlements/towns with grid electricity access. Then a minimum spanning tree is calculated for these connect points, using a many-to-many variant Dijkstra algorithm and using existing road networks as a cost function. Adapted from this work from Facebook. Currently gridfinder only uses road networks, but it would be trivial to add other cost parameters such as slope or terrain.

The algorithm looks as follows in process, guessing the grid network for Uganda:

Animated algorithm

Input requirements

gridfinder requires the following data sources:

  • VIIRS data, monthly and annual composites available here.
  • OSM highway data, most easily available using the HOT Export Tool, otherwise geofabrik

Model usage

To get to grips with the API and steps in the model, open the Jupyter notebook example.ipynb. This repository includes the input data needed to do a test run for Burundi, so it should be a matter of openening the notebook and running all cells.

Installation

Install with pip

pip install gridfinder

Note: On some operating systems (Ubuntu 18.04), you may get an error about libspatialindex. To overcome this on Ubuntu, run:

sudo apt install libspatialindex-dev

Development

Download or clone the repository and install the required packages (preferably in a virtual environment):

git clone https://github.com/carderne/gridfinder.git
cd gridfinder
rye sync

Useful commands:

rye fmt
rye lint
rye run check  # type check
rye run test

Release files for gridfinder 3.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gridfinder 3.1.2
File Size Uploaded
gridfinder-3.1.2.tar.gz 5.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for gridfinder 3.1.2
File Interpreter ABI Platform
gridfinder-3.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.6 MB

Release files / gridfinder-3.1.2.tar.gz

Download URL gridfinder-3.1.2.tar.gz
Size 5.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7ff0301c37f3a7aa013c7a205d3848dce2388250ccc72a74102c02ff40ee872f
BLAKE2b-256 checksum
How to use checksums
a3098fb22a2402cf0d18600e602b470c78f8be5a7d1bd1221dc3492076fd8894
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / gridfinder-3.1.2-py3-none-any.whl

Download URL gridfinder-3.1.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11d73c3b1713e0362c4d6a6340679699c2f7c1e5b6a48a7bf3f3eeebe35aa4fe
BLAKE2b-256 checksum
How to use checksums
efc9d24411c33370f48baabb31fd2eb522c6b900a0b6089cfe433675802028e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

3.1.2 This release

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page