Skip to content

pypsa-meets-earth/pypsa-earth-osm

 
 

Repository files navigation

PyPSA-Earth-OSM: enabling synergies between OSM enhansment and energy modelling.

by

Development Status: In progress

Test workflows Size License: AGPL v3 REUSE status Code style: black pre-commit.ci status Discord

That is an experimental modeling implementation intended to be used for bridging OSM mapping work with enhansement of the energy modelling workflow.

To run the stable modelling workflow for any country of the workd, please refer to PyPSA-Earth repository.

Repository Structure

PyPSA-Earth-OSM uses a multi-branch development strategy to enable parallel work on general features and country-specific modeling:

Branch Overview

  • development (Main development branch): Contains general features, enhancements, and infrastructure improvements for the Earth-OSM workflow. All new features and bug fixes should be developed here first.

  • columbia-modeling: Dedicated branch for Colombia-specific energy system modeling. Contains configurations, data, and analysis specific to Colombia's power grid.

  • bolivia-modeling: Dedicated branch for Bolivia-specific energy system modeling. Contains configurations, data, and analysis specific to Bolivia's power grid.

Contributing Guidelines

  • For general features: Create feature branches from development and submit pull requests to development.
  • For country-specific modeling: Work on the respective country branch (columbia-modeling or bolivia-modeling).
  • Keeping branches updated: Country-specific branches should periodically merge updates from development to incorporate new features and fixes.

This structure allows researchers to focus on specific country analyses while maintaining a common codebase for shared functionality.

How Earth-OSM Works

PyPSA-Earth-OSM leverages OpenStreetMap (OSM) data to build power grid topology models for energy system analysis. The workflow extracts, processes, and validates power infrastructure data from OSM, enabling researchers to analyze electricity networks using crowd-sourced geographic information.

Data Sources and Workflow

The Earth-OSM workflow supports three different approaches for obtaining OpenStreetMap data:

1. Latest OSM Data (Default)

Downloads the most current version of OSM data directly from OpenStreetMap servers. This ensures access to the latest updates from the OSM community, including recent infrastructure additions and corrections.

2. Historical OSM Data

Enables analysis of past grid configurations by downloading OSM data from a specific date. This is valuable for:

  • Temporal analysis and grid evolution studies
  • Validation against historical records
  • Reproducibility of previous research
  • Comparison of infrastructure development over time

Historical data is available from approximately 2012 onwards, depending on OSM data availability.

3. Custom OSM Data

Allows users to provide their own OpenStreetMap data files (in .pbf format). This option is useful for:

  • Working with locally cached OSM data
  • Using pre-processed or validated OSM datasets
  • Offline workflows or environments with limited internet access
  • Testing with specific OSM data snapshots

Configuration Options

The osm_data section in the configuration file (config.default.yaml or config.yaml) controls how Earth-OSM retrieves and processes OpenStreetMap data:

osm_data:
  source: "latest"  # Options: "latest", "historical", or "custom"

  # For historical data
  target_date: "2020-01-01"  # Format: YYYY-MM-DD

  # For custom data
  custom_path:
    pbf: "data/custom/osm/pbf"      # Path to custom .pbf files (required)
    power: "data/custom/osm/power"  # Path to processed power files (optional)

Key Configuration Parameters:

  • source: Determines the OSM data source

    • "latest": Downloads current OSM data (default)
    • "historical": Downloads OSM data from a specific date
    • "custom": Uses user-provided OSM files
  • target_date: Specifies the date for historical data (format: YYYY-MM-DD)

    • Only used when source: "historical"
    • Example dates: "2018-01-01", "2020-06-15", "2022-12-31"
  • custom_path: Defines paths for custom OSM data files

    • pbf: Directory containing raw OSM data files (.osm.pbf format)
      • Files must follow naming pattern: <country>-latest.osm.pbf
      • Example: bolivia-latest.osm.pbf, nigeria-latest.osm.pbf
    • power: Directory for pre-processed power infrastructure JSON files (optional)

Data Processing Pipeline

Once OSM data is obtained, Earth-OSM processes it through several stages:

  1. Download/Load: Retrieves OSM data based on the configured source
  2. Filter: Extracts power infrastructure elements (substations, lines, cables, generators)
  3. Clean: Validates and standardizes the data using configurable thresholds and rules
  4. Build Network: Constructs the power network topology, connecting buses and lines
  5. Validate: Performs quality checks and consistency validation

Collaborators

FabianHofmann
FabianHofmann
fneum
fneum
ekatef
ekatef
euronion
euronion
Justus-coded
Justus-coded
mnm-matin
mnm-matin
GbotemiB
GbotemiB
martacki
martacki
LukasFrankenQ
LukasFrankenQ
pz-max
pz-max
davide-f
davide-f
koen-vg
koen-vg
Eddy-JV
Eddy-JV
hazemakhalek
hazemakhalek
energyLS
energyLS
AnasAlgarei
AnasAlgarei
yerbol-akhmetov
yerbol-akhmetov
doneachh
doneachh
danielelerede-oet
danielelerede-oet
DeniseGiub
DeniseGiub
finozzifa
finozzifa
virio-andreyana
virio-andreyana
Tomkourou
Tomkourou
Eric-Nitschke
Eric-Nitschke
GridGrapher
GridGrapher
drifter089
drifter089
glenkiely-ieg
glenkiely-ieg
ljansen-iee
ljansen-iee
Emre-Yorat89
Emre-Yorat89
giacfalk
giacfalk
Ekaterina-Vo
Ekaterina-Vo
lkstrp
lkstrp
TosinGeorge
TosinGeorge
Ly0n
Ly0n
Tooblippe
Tooblippe
cpschau
cpschau
arizeosalac
arizeosalac
SermishaNarayana
SermishaNarayana
AlexanderMeisinger
AlexanderMeisinger
asolavi
asolavi
rajesh-ieg
rajesh-ieg
LucieRC
LucieRC
choiHenry
choiHenry
gianvicolux
gianvicolux
carlosfv92
carlosfv92
saikumarvasa100-hash
saikumarvasa100-hash
rsparks3
rsparks3
ollie-bell
ollie-bell
juli-a-ko
juli-a-ko
squoilin
squoilin
siddharth-krishna
siddharth-krishna
pitmonticone
pitmonticone
PierreKara1
PierreKara1
Netotse
Netotse
milyas009
milyas009
kma33
kma33
jome1
jome1
jessLryan
jessLryan
jarry7
jarry7
huyhoang-mike
huyhoang-mike
HanaElattar
HanaElattar
Vamsipriya22
Vamsipriya22
flacombe
flacombe
EmreYorat
EmreYorat
AndreCNF
AndreCNF
AlessandroPampado99
AlessandroPampado99

About

PyPSA-Earth-OSM: Exploring Synergies between OSM data and energy planning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Other 0.4%