Skip to content
open-energy-transitionPublic

Repository files navigation

EarthPV logo

EarthPV

Free and open mapping of photovoltaics around the Earth!
Including Capacity, Growth and Orientation Systems Above 10 kWp

Documentation  ·  Country atlases  ·  Pretrained model  ·  Set up a new country  ·  Experiments  ·  Discord


Warning

Active development. EarthPV is research software in the alpha stage that relies heavily on content generated by LLM. Its detectors, calibration and headline numbers are still being tested and revised, not settled.

Many countries do not know how much solar power sits on their roofs, or where. EarthPV answers that from space with free data: it detects PV arrays in Sentinel-2 satellite imagery, turns them into capacity estimates, and hands each detection to OpenStreetMap mappers to verify. What they confirm trains the next model. Built only on open models and global datasets, it works for any country.

Video thumbnail: We are mapping solar panels in every country, by Open Energy Transition. Click to watch on YouTube.

Watch We are mapping solar panels in every country, EarthPV explained by Open Energy Transition.

Evidence atlas

Each country gets an interactive evidence atlas: hand-mapped OpenStreetMap installations plus the model's own detections, per 0.1° cell, with a 90% range on the headline figure. Atlases are tiered by calibration; mapping calibration areas is how an atlas moves up, so maps a calibration area.

Tier Country What the atlas rests on
Gold Pakistan Installations above and below 400 m², the small ones calibrated on areas mapped panel by panel
Silver Germany, France, Yemen 400 m² and up, checked against the national register (Germany, France) and hand-mapped communes (France). Germany also shows a small-installation estimate fitted to its register, not yet validated; France has none. Yemen has its first area mapped panel by panel, not yet used by any figure
Bronze Egypt, India, Morocco, Nigeria, Poland, South Africa, Vietnam, Zambia 400 m² and up, not yet calibrated: hand-mapped installations plus what the model outlines; small installations missing

The EarthPV evidence atlas: Pakistan's rooftop solar capacity, best estimate 34,589 MWp (90 percent range 29,308 to 41,736), a night-lights style map of estimated capacity per 0.1 degree cell concentrated in the Punjab corridor and the Karachi industrial belt.

How it works

At Sentinel-2's 10 m resolution a large array has a shape you can trace and a small one does not, so EarthPV runs two instruments and combines them.

  • Segmentation, the fine-tuned TerraMind, outlines arrays above roughly 400 m². Every detection becomes a ranked mapping lead, and it is the only instrument for ground-mounted solar at any size.
  • roofclf asks a smaller question of every building: does this roof carry PV? A 100 m² array is a handful of mixed pixels, too few to outline but often enough to classify. It is cross-checked with SPPI, a zero-training spectral index, and calibrated on areas where every installation was mapped by hand.

earthpv atlas combines both with the hand-mapped OpenStreetMap layer into a Best estimate, with overlaps removed and a 90% range attached. A country with neither hand-mapped calibration areas nor a register gets the segmentation half only.

The evidence atlas workflow: Sentinel-2 imagery, OpenStreetMap solar mapping and VIDA building footprints feed two detectors, TerraMind segmentation for arrays of 400 square metres and above plus all ground-mount, and the per-building roofclf classifier cross-checked with SPPI. Both are calibrated against hand-mapped ground-truth quadrats, then combined with overlaps removed into the published evidence atlas.

The OpenStreetMap loop. Sentinel-2 is free but coarse; Esri, Bing and Mapbox resolve individual panels but only let a person trace from them in the OpenStreetMap editor. So the model reads only Sentinel-2, people read only the high-resolution layers, and what they map becomes openly licensed training data for the next model. Around that loop people also map calibration areas completely, so the small-installation estimate can be fitted and checked, and track down the registers and statistics a country already keeps; each country's model is then retrained on its own labels. An LLM assistant helps at every step and makes none of the calls: it never edits OpenStreetMap or signs off a number. See Contribute data.

The mapping flywheel: six numbered stations run clockwise round a ring with OpenStreetMap at the hub. 1, detect from space with each country's TerraMind model and the small-installation classifiers. 2, publish the evidence atlas with mapping leads and areas to map. 3, people map the leads of 400 square metres and more. 4, people map calibration areas completely. 5, people investigate local datasets such as registers and official statistics. 6, retrain the models and recalibrate on what was mapped. Arrows from stations 3 and 4 carry mapped panels into OpenStreetMap, and arrows out of it carry them to the atlas as counted capacity and to retraining as labels. A dashed frame round the whole wheel marks an LLM assistant that helps at every station but never edits OpenStreetMap, declares an area complete or signs off a number.

Keeping it current. An update is a re-run on new imagery, and each round starts from a better map: confirmed leads become verified capacity and training data. See Keeping PV data current.

The same detections also give panel tilt and orientation from Sentinel-2 glint and growth since 2021/22. Everything tried, kept or rejected, with the measurement behind each verdict, is in Experiments.

How small an installation does it find?

Measured on 30 exhaustively hand-mapped Pakistani calibration areas (123,898 buildings), at the operating point the published atlas uses:

Panel area on the roof Roughly Found
Above 100 m² above 20 kWp 92% rising to over 99%
50 to 100 m² 10 to 20 kWp 83%
20 to 50 m² 4 to 9 kWp 49%
Below 20 m² below 4 kWp 22 to 31%

Most rooftop PV above about 50 m² of panel (roughly 10 kWp) is found, 20 to 50 m² is close to a coin flip, and most smaller systems are missed. Detection is recall-first: about 1 in 10 PV-free buildings is also flagged, so detections are leads for human verification, not a finished inventory. Where household systems are a fraction of a pixel, as in France, the small-rooftop half does not work at all.

Run the pretrained model

The segmentation model is published as a GitHub release: TerraMind tiny fine-tuned on OpenStreetMap solar labels from Germany, Pakistan, India, France and South Africa, 33 MB, and the best of seven checkpoints on held-out regions in eleven countries. You need Linux and an NVIDIA GPU; a 6 GB GTX 1060 is enough.

git clone https://github.com/open-energy-transition/earthpv.git && cd earthpv
pixi install && pixi install -e ml     # data pipeline, then PyTorch and TerraTorch
pixi run fetch-model                   # downloads the checkpoint and checks its SHA-256

pixi run python scripts/new_region.py add --aoi <aoi> --bbox <bbox> --iso3 <ISO3>
pixi run earthpv compose --aoi <aoi> --window <clear-season START:END>    # hours
pixi run -e ml earthpv infer --aoi <aoi> --checkpoint data/models/release/earthpv_segmentation_v14.ckpt
pixi run earthpv postprocess --aoi <aoi> --threshold 0.3
pixi run earthpv export --aoi <aoi>    # ranked candidates for OpenStreetMap mappers

It finds arrays of roughly 400 m² and up, and ground-mount at any size; small rooftop systems need the locally calibrated roofclf half. What it was trained on, how it scores in each country and where it fails: Pretrained model.

Add your country

The goal is a global atlas assembled country by country, each run and checked by people who know the ground. Every input is global, so the intended shape is a fork per country with the results coming back here. There is no combiner that merges countries into one global surface yet; the shared pipeline, atlas format and data-pack layout are what make that possible later.

gh repo fork open-energy-transition/earthpv --clone --remote
cd earthpv && git switch -c atlas/<country>

pixi run python scripts/new_region.py check --bbox <bbox> --iso3 <ISO3>   # preflight
pixi run python scripts/new_region.py add   --aoi <country> --bbox <bbox> --iso3 <ISO3>
pixi run python scripts/new_region.py plan  --aoi <country>               # your runbook

Every stage is resumable; compose, which builds the imagery, is the long pole at days on a home connection. Package the per-cell capacity table with scripts/build_atlas_data_pack.py and ship it as a GitHub Release asset: commit the manifest, never the pack. One step cannot be automated: after national roofclf scoring, check 20 random cells against high-resolution imagery.

Working with an agent such as Claude Code? CLAUDE.md is the repository's agent brief. Let it run the preflight, the config, the long stages and the draft page, and stop it before anything that needs human eyes: drawing or certifying calibration areas, and signing off validation. Full runbook: Contribute your country atlas back.

Community

EarthPV is the software half of TraceTheSun, a pilot run by Open Energy Transition to make PV mapping cost-effective, verifiable, community-driven and local, worldwide, conceived by Tobias Augspurger and Muhammad Awais. The Pakistani results rest on a student team at the Centre for Water Informatics and Technology (WIT), Lahore University of Management Sciences: Laeeba Hafeez Malik, Tayyiba Shafiq, Nimra Aamir Ali and Vania Malik, who co-designed the pipeline and did the mapping, validation and ground-truth work that makes the numbers checkable. Join the community on Discord.

Licence

Code MIT. The released segmentation model's weights are Apache-2.0, like the TerraMind model they are fine-tuned from; its NOTICE lists the attributions to keep. Imagery from Copernicus Sentinel-2; building footprints from VIDA Open Buildings and Overture Maps; labels from OpenStreetMap contributors under ODbL; administrative boundaries from geoBoundaries under CC-BY; solar-panel import figures from Ember under CC-BY-4.0.

Published data outputs (the atlases, capacity tables, raw detections and any other derived dataset offered for download) are derivative databases of OpenStreetMap's solar labels and, via VIDA Open Buildings, of Microsoft and Google building footprints, so under ODbL's share-alike clause they are licensed under the Open Database License (ODbL) v1.0. Any use must attribute © OpenStreetMap contributors, VIDA Open Buildings (CC BY 4.0) for the footprints and, for anything derived from the German validation, the Marktstammdatenregister (Bundesnetzagentur, Datenlizenz Deutschland - Namensnennung - Version 2.0).

Releases

Packages

Contributors

Languages