{"id":13856840,"url":"https://github.com/pyrosm/pyrosm","last_synced_at":"2025-12-12T00:34:09.092Z","repository":{"id":39403592,"uuid":"250028367","full_name":"pyrosm/pyrosm","owner":"pyrosm","description":"Read OpenStreetMap data from Protobuf files into GeoDataFrame with Python, faster. ","archived":false,"fork":false,"pushed_at":"2024-12-10T09:39:02.000Z","size":18256,"stargazers_count":382,"open_issues_count":79,"forks_count":44,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-17T07:26:48.137Z","etag":null,"topics":["geopandas","openstreetmap","python"],"latest_commit_sha":null,"homepage":"https://pyrosm.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyrosm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-25T16:15:21.000Z","updated_at":"2025-04-12T17:32:51.000Z","dependencies_parsed_at":"2022-08-09T14:48:46.034Z","dependency_job_id":"ecb455c4-63a0-41c9-82d8-8041fdefccae","html_url":"https://github.com/pyrosm/pyrosm","commit_stats":{"total_commits":642,"total_committers":6,"mean_commits":107.0,"dds":"0.15887850467289721","last_synced_commit":"66de74bd0496d1148618842cac58923bf22d97ea"},"previous_names":["htenkanen/pyrosm"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrosm%2Fpyrosm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrosm%2Fpyrosm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrosm%2Fpyrosm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrosm%2Fpyrosm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyrosm","download_url":"https://codeload.github.com/pyrosm/pyrosm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geopandas","openstreetmap","python"],"created_at":"2024-08-05T03:01:15.556Z","updated_at":"2025-12-12T00:34:09.024Z","avatar_url":"https://github.com/pyrosm.png","language":"Python","readme":"# Pyrosm \n[![Conda version](https://anaconda.org/conda-forge/pyrosm/badges/version.svg)](https://anaconda.org/conda-forge/pyrosm/)\n[![PyPI version](https://badge.fury.io/py/pyrosm.svg)](https://badge.fury.io/py/pyrosm)\n[![Documentation Status](https://readthedocs.org/projects/pyrosm/badge/?version=latest)](https://pyrosm.readthedocs.io/en/latest/?badge=latest)\n[![Coverage Status](https://codecov.io/gh/HTenkanen/pyrosm/branch/master/graph/badge.svg)](https://codecov.io/gh/HTenkanen/pyrosm) \n[![PyPI - Downloads](https://img.shields.io/pypi/dm/pyrosm?color=yellow\u0026label=Downloads)](https://pypistats.org/packages/pyrosm)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4279527.svg)](https://doi.org/10.5281/zenodo.4279527)\n[![License](https://anaconda.org/conda-forge/pyrosm/badges/license.svg)](https://anaconda.org/conda-forge/pyrosm/)\n\n\n**Pyrosm** is a Python library for reading OpenStreetMap data from Protocolbuffer Binary Format -files (`*.osm.pbf`) into Geopandas GeoDataFrames. \nPyrosm makes it easy to extract various datasets from OpenStreetMap pbf-dumps including e.g. road networks, buildings, \nPoints of Interest (POI), landuse and natural elements. Also fully customized queries are supported which makes it possible \nto parse the data from OSM with more specific filters.\n \n**Pyrosm** is easy to use and it provides a somewhat similar user interface as [OSMnx](https://github.com/gboeing/osmnx).\nThe main difference between pyrosm and OSMnx is that OSMnx reads the data over internet using OverPass API, whereas pyrosm reads the data from local OSM data dumps\nthat can be downloaded e.g. from [GeoFabrik's website](http://download.geofabrik.de/). This makes it possible to read data faster thus \nallowing e.g. parsing street networks for the whole country fairly efficiently (however, see [caveats](#caveats)).\n\nThe library has been developed by keeping performance in mind, hence, it is mainly written in Cython (*Python with C-like performance*) \nwhich makes it fast to parse OpenStreetMap data from PBF files.\nPyrosm is built on top of another Cython library called [Pyrobuf](https://github.com/appnexus/pyrobuf) which is a faster Cython alternative \nGoogle's version with C++ backend. Google's Protocol Buffers is a commonly used and efficient method to serialize and compress structured data \nwhich is also used by OpenStreetMap contributors to distribute the OSM data in PBF format (Protocolbuffer Binary Format). \n\n**Documentation** is available at [https://pyrosm.readthedocs.io](https://pyrosm.readthedocs.io/en/latest/).\n\n## Current features\n\n - download PBF data easily from hundreds of locations across the world\n - read street networks (separately for driving, cycling, walking and all-combined)\n - read buildings from PBF\n - read Points of Interest (POI) from PBF\n - read landuse from PBF\n - read \"natural\" from PBF\n - read boundaries from PBF (+ allow searching by name)\n - read any other data from PBF by using a custom user-defined filter\n - filter data based on bounding box\n - export networks as a directed graph to `igraph`, `networkx` and `pandana`\n \n## Install\n\nPyrosm is distributed via PyPi and conda-forge. \n\nThe recommended way to install pyrosm is using `conda` package manager:\n\n`$ conda install -c conda-forge pyrosm`\n\nYou can also install the package with pip:\n\n`$ pip install pyrosm`\n\n### Troubleshooting\n\nNotice that `pyrosm` requires geopandas to work. \nOn Linux and Mac installing geopandas with `pip` should work without a problem, which is handled automatically when installing pyrosm. \n\nHowever, on Windows installing geopandas with pip is likely to cause issues, hence, it is recommended to install Geopandas before installing\n`pyrosm`. See instructions from [Geopandas website](https://geopandas.org/install.html#installation).\n\n## When should I use Pyrosm?\n\nPyrosm can of course be used whenever you need to parse data from OSM into geopandas GeoDataFrames.\nHowever, `pyrosm` is better suited for situations where you want to fetch data for whole city or larger regions (even whole country).\n\nIf you are interested to fetch OSM data for smaller areas such as neighborhoods, or search data around a specific location/address,\nwe recommend using [OSMnx](https://github.com/gboeing/osmnx) which is more flexible in terms of specifying the area of interest.\nThat being said, it is also possible to extract neighborhood level information with pyrosm and filter data based on a bounding box\n(see [docs](https://pyrosm.readthedocs.io/en/latest/basics.html#filtering-data-based-on-bounding-box)).\n\n## How to use?\n\nUsing `pyrosm` is straightforward. See [docs](https://pyrosm.readthedocs.io/en/latest/basics.html) \nfor instructions how to use the library.\n\n## Get in touch + contributions\n\nIf you find a bug from the tool, have question, or would like to suggest a new feature to it, you can [make a new issue here](https://github.com/HTenkanen/pyrosm/issues).\n\nWe warmly welcome contributions to `pyrosm` to make it better. If you are interested in contributing to the library,\nplease check the [contribution guidelines](https://pyrosm.readthedocs.io/en/latest/contributions.html).\n\n## Development\n\nYou can install a local development version of the tool by 1) installing necessary packages with conda and 2) building pyrosm from source:\n\n 1. install conda-environment for Python 3.12 by:\n \n    - Python 3.12 (you might want to modify the env-name which is `test` by default): `$ conda env create -f ci/312-conda.yaml`\n    \n 2. build pyrosm development version from master (activate the environment first):\n \n    - `pip install -e .`\n\nYou can run tests with `pytest` by executing:\n \n  `$ pytest . -v` \n  \n\n## License and copyright\n\nPyrosm is licensed under MIT (see [license](LICENSE)). \n\nThe OSM data is downloaded from two sources:\n\n[![Website](https://img.shields.io/website/https/download.geofabrik.de?label=Data%20source\u0026up_color=9cf\u0026up_message=http%3A%2F%2Fdownload.geofabrik.de)](https://download.geofabrik.de/)\n[![Website](https://img.shields.io/website/https/download.bbbike.org/osm?label=Data%20source\u0026up_color=9cf\u0026up_message=http%3A%2F%2Fdownload.bbbike.org%2Fosm)](https://download.bbbike.org/osm/)\n\nData \u0026copy; [Geofabrik GmbH](http://www.geofabrik.de/), [BBBike](https://download.bbbike.org/) and [OpenStreetMap Contributors](http://www.openstreetmap.org/) \n\nAll data from the [OpenStreetMap](https://www.openstreetmap.org) is licensed under the [OpenStreetMap License](https://www.openstreetmap.org/copyright). \n\n## Caveats\n\n### Filtering large files by bounding box \n\nAlthough `pyrosm` provides possibility to filter even larger data files based on bounding box, \nthis process can slow down the reading process significantly (1.5-3x longer) due to necessary lookups when parsing the data. \nThis might not be an issue with smaller files (up to ~100MB) but with larger data dumps this can take longer than necessary.\n\nHence, a recommended approach with large data files is to **first** filter the protobuf file based on bounding box into a \nsmaller subset by using a dedicated open source Java tool called [Osmosis](https://wiki.openstreetmap.org/wiki/Osmosis) \nwhich is available for all operating systems. Detailed installation instructions are [here](https://wiki.openstreetmap.org/wiki/Osmosis/Installation), \nand instructions how to filter data based on bounding box are [here](https://wiki.openstreetmap.org/wiki/Osmosis/Examples#Extract_administrative_Boundaries_from_a_PBF_Extract).\n\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrosm%2Fpyrosm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyrosm%2Fpyrosm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrosm%2Fpyrosm/lists"}