earth-osm
Export infrastructure data from OpenStreetMap using Python
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 7 committers (28.6%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.9%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Export infrastructure data from OpenStreetMap using Python
Basic Info
- Host: GitHub
- Owner: pypsa-meets-earth
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://pypsa-meets-earth.github.io/earth-osm/
- Size: 1020 KB
Statistics
- Stars: 36
- Watchers: 2
- Forks: 15
- Open Issues: 6
- Releases: 16
Topics
Metadata Files
README.md
📚 Overview
earth-osm downloads, filters, cleans and exports infrastructure data from OpenStreetMap (OSM). It provides a Python API and a CLI interface to extract data for various infrastructure types, such as power lines, substations, and more.
🌟 Key Features
- 🔌 Extracts infrastructure data from OSM
- 🧹 Cleans and standardizes the data (coming soon)
- 🚀 No API rate limits (data served from GeoFabrik)
- 🐍 Provides a Python API
- 🖥️ Supports multiprocessing for faster extraction
- 📊 Outputs data in .csv and .geojson formats
- 🌍 Supports global data extraction
- 🖱️ Easy-to-use CLI interface
🚀 Getting Started
Installation
Install earth-osm using pip (recommended):
bash
pip install earth-osm
Or with conda:
bash
conda install --channel=conda-forge earth-osm
Basic Usage
Extract OSM data using the CLI:
bash
earth_osm extract power --regions benin monaco --features substation line
This command extracts power infrastructure data for Benin and Monaco, focusing on substations and power lines. By default, the resulting .csv and .geojson files are stored in ./earth_data/out.
Load the extracted data using pandas:
```python import pandas as pd import geopandas as gpd
For Pandas
dfsubstations = pd.readcsv('./earthdata/out/BJraw_substations.csv')
For GeoPandas
gdfsubstations = gpd.readfile('./earthdata/out/BJraw_substations.geojson') ```
🛠️ CLI Reference
Extract Command
bash
earth_osm extract <primary> --regions <region1> <region2> ... [options]
Arguments:
<primary>: Primary feature to extract (e.g power)
Required Options:
--regions: Specify one or more regions using ISO 3166-1 alpha-2, ISO 3166-2 codes, or full names
Tip: A list of regions is available at regions.md
Optional Arguments:
| Argument | Description | Default |
|----------|-------------|---------|
| --features | Specify sub-features of the primary feature | All features |
| --update | Update existing data | False |
| --no_mp | Disable multiprocessing | False (MP enabled) |
| --data_dir | Path to data directory | './earthdata' |
| `--outdir| Path to output directory | Same as data_dir |
|--outformat| Export format(s): csv and/or geojson | ['csv', 'geojson'] |
|--aggfeature| Aggregate outputs by feature | False |
|--agg_region` | Aggregate outputs by region | False |
🐍 Python API
For more advanced usage, you can use the Python API:
```python import earth_osm as eo
eo.saveosmdata( primaryname='power', regionlist=['benin', 'monaco'], featurelist=['substation', 'line'], update=False, mp=True, datadir='./earthdata', outformat=['csv', 'geojson'], out_aggregate=False, ) ```
🛠️ Development
To contribute to earth-osm, follow these steps:
(Optional) Install a specific version of earth_osm:
bash pip install git+https://github.com/pypsa-meets-earth/earth-osm.git@<required-commit-hash>(Optional) Create a virtual environment for Python >=3.10:
bash python3 -m venv .venv source .venv/bin/activateInstall the development dependencies:
bash pip install git+https://github.com/pypsa-meets-earth/earth-osm.git pip install -e .[dev]Read the CONTRIBUTING.md file for more detailed information on how to contribute to the project.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
🤝 Community
Join our Discord community to connect with other users and contributors, ask questions, and get support.
📚 Documentation
For more detailed information, check out our full documentation.
Made with ❤️ by the PyPSA meets Earth team
Owner
- Name: PyPSA meets Earth
- Login: pypsa-meets-earth
- Kind: organization
- Website: https://pypsa-meets-earth.github.io/
- Twitter: pypsameetsearth
- Repositories: 11
- Profile: https://github.com/pypsa-meets-earth
An open source energy system model initiative for our Earth
GitHub Events
Total
- Create event: 9
- Commit comment event: 1
- Release event: 9
- Issues event: 5
- Watch event: 7
- Delete event: 6
- Issue comment event: 23
- Push event: 23
- Pull request review event: 1
- Pull request event: 6
- Fork event: 5
Last Year
- Create event: 9
- Commit comment event: 1
- Release event: 9
- Issues event: 5
- Watch event: 7
- Delete event: 6
- Issue comment event: 23
- Push event: 23
- Pull request review event: 1
- Pull request event: 6
- Fork event: 5
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| mnm-matin | m****9@g****m | 138 |
| Matin Mahmood | m****d@e****k | 54 |
| Max Parzen | m****n@e****k | 30 |
| Davide Fioriti | f****s@g****m | 17 |
| Matin Mahmood | 4****n@u****m | 15 |
| Davide Fioriti | 6****f@u****m | 5 |
| Fabian Hofmann | f****f@g****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 40
- Total pull requests: 20
- Average time to close issues: 3 months
- Average time to close pull requests: 5 days
- Total issue authors: 14
- Total pull request authors: 5
- Average comments per issue: 1.7
- Average comments per pull request: 1.45
- Merged pull requests: 18
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 3
- Average time to close issues: 25 days
- Average time to close pull requests: 5 days
- Issue authors: 4
- Pull request authors: 1
- Average comments per issue: 0.5
- Average comments per pull request: 3.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- pz-max (15)
- davide-f (7)
- mnm-matin (5)
- DeniseGiub (2)
- zoobar (1)
- dziegler991 (1)
- ekatef (1)
- bobbyxng (1)
- FabianHofmann (1)
- simulkade (1)
- Wuhochi (1)
- jome1 (1)
- LRydin (1)
- FlorianK13 (1)
Pull Request Authors
- davide-f (10)
- pz-max (8)
- mnm-matin (5)
- FabianHofmann (2)
- simulkade (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 318 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 16
- Total maintainers: 3
pypi.org: earth-osm
Python tool to extract large-amounts of OpenStreetMap data
- Homepage: https://github.com/pypsa-meets-earth/earth-osm/
- Documentation: https://earth-osm.readthedocs.io/
- License: MIT License
-
Latest release: 0.1.0
published almost 3 years ago
Rankings
Dependencies
- black * test
- codecov * test
- coverage * test
- flake8 * test
- gitchangelog * test
- isort * test
- mkdocs * test
- mypy * test
- pytest * test
- pytest-cov * test
- geopandas *
- pandas *
- protobuf *
- requests *
- tqdm *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v3 composite
- actions/checkout v2 composite
- actions/checkout v1 composite
- actions/setup-python v1 composite
- softprops/action-gh-release v1 composite
- geopandas *
- pandas *
- protobuf >=4.21.1
- requests *
- tqdm *