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.
PyPSA-Earth-OSM uses a multi-branch development strategy to enable parallel work on general features and country-specific modeling:
-
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.
- For general features: Create feature branches from
developmentand submit pull requests todevelopment. - For country-specific modeling: Work on the respective country branch (
columbia-modelingorbolivia-modeling). - Keeping branches updated: Country-specific branches should periodically merge updates from
developmentto incorporate new features and fixes.
This structure allows researchers to focus on specific country analyses while maintaining a common codebase for shared functionality.
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.
The Earth-OSM workflow supports three different approaches for obtaining OpenStreetMap data:
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.
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.
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
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"
- Only used when
-
custom_path: Defines paths for custom OSM data filespbf: Directory containing raw OSM data files (.osm.pbfformat)- Files must follow naming pattern:
<country>-latest.osm.pbf - Example:
bolivia-latest.osm.pbf,nigeria-latest.osm.pbf
- Files must follow naming pattern:
power: Directory for pre-processed power infrastructure JSON files (optional)
Once OSM data is obtained, Earth-OSM processes it through several stages:
- Download/Load: Retrieves OSM data based on the configured source
- Filter: Extracts power infrastructure elements (substations, lines, cables, generators)
- Clean: Validates and standardizes the data using configurable thresholds and rules
- Build Network: Constructs the power network topology, connecting buses and lines
- Validate: Performs quality checks and consistency validation