PyDriosm: an open-source tool for downloading, reading and PostgreSQL-based I/O of OpenStreetMap data

mikeqfu, updated 🕥 2023-02-27 14:22:08

PyDriosm

|PyPI| |Python| |Documentation| |License| |Codacy grade| |DOI|

.. |PyPI| image:: https://img.shields.io/pypi/v/pydriosm :alt: PyPI - Release :target: https://pypi.org/project/pydriosm/ .. |Python| image:: https://img.shields.io/pypi/pyversions/pydriosm :alt: PyPI - Python version :target: https://docs.python.org/3/ .. |Documentation| image:: https://readthedocs.org/projects/pydriosm/badge/?version=latest :alt: ReadTheDocs - Documentation status :target: https://pydriosm.readthedocs.io/en/latest/?badge=latest .. |License| image:: https://img.shields.io/pypi/l/pydriosm :alt: PyPI - License :target: https://github.com/mikeqfu/pydriosm/blob/master/LICENSE .. |Codacy grade| image:: https://app.codacy.com/project/badge/Grade/b411ce89cbc445f58377a5799646d4cb :alt: Codacy grade (Code quality) :target: https://www.codacy.com/gh/mikeqfu/pydriosm/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mikeqfu/pydriosm&utm_campaign=Badge_Grade .. |DOI| image:: https://zenodo.org/badge/92493726.svg :alt: Zenodo - DOI :target: https://zenodo.org/badge/latestdoi/92493726

PyDriosm is an open-source tool for researchers/practitioners to easily download and read OpenStreetMap <https://www.openstreetmap.org/> (OSM) data in popular file formats such as protobuf binary format <https://wiki.openstreetmap.org/wiki/PBF_Format> (PBF) and shapefile <https://wiki.openstreetmap.org/wiki/Shapefiles>, which are available for free download from Geofabrik <https://download.geofabrik.de/> and BBBike <https://download.bbbike.org/>. The package also provides a convenient way for PostgreSQL <https://www.postgresql.org/>-based I/O and storage of parsed OSM data.

Installation

To install the latest release of pydriosm from PyPI <https://pypi.org/project/pydriosm/> via pip <https://pip.pypa.io/en/stable/cli/pip/>:

.. code-block:: bash

pip install --upgrade pydriosm

For more information, please refer to Installation <https://pydriosm.readthedocs.io/en/latest/installation.html>_.

Documentation

The full PyDriosm documentation (including detailed examples and a quick-start tutorial) is hosted on ReadTheDocs <https://readthedocs.org/projects/pydriosm/>: [HTML <https://pydriosm.readthedocs.io/en/latest/>] [PDF <https://pydriosm.readthedocs.io/_/downloads/en/latest/pdf/>_].

License

  • PyDriosm is licensed under GNU General Public License v3 <https://github.com/mikeqfu/pydriosm/blob/master/LICENSE>_ or later (GPLv3+).
  • The free OpenStreetMap <https://www.openstreetmap.org/> data, which is used for the development of PyDriosm, is licensed under the Open Data Commons Open Database License <https://opendatacommons.org/licenses/odbl/> (ODbL) by the OpenStreetMap Foundation <https://osmfoundation.org/>_ (OSMF).

Cite as

Fu, Q. (2020). PyDriosm: an open-source tool for downloading, reading and PostgreSQL-based I/O of OpenStreetMap data. doi:10.5281/zenodo.4281194 <https://doi.org/10.5281/zenodo.4281194>_

.. code-block:: bibtex

@software{qian_fu_pydriosm_4281194,
  author    = {Qian Fu},
  title     = {{PyDriosm: an open-source tool for downloading, reading
                and PostgreSQL-based I/O of OpenStreetMap data}},
  year      = 2020,
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.4718623},
  url       = {https://doi.org/10.5281/zenodo.4281194}
}

Note: Please also refer to the export options from Zenodo <https://zenodo.org/search?page=1&size=20&q=conceptrecid:4281194&all_versions&sort=-version>_ to reference the specific version of PyDriosm as appropriate.

Issues

Compatible with Historic OSM data file (.osh.pbf)

opened on 2021-05-05 00:29:30 by sarabjot294

Using a tool to work with historic osm data would be great.

Find Nodes Associated With a Way

opened on 2019-10-15 13:18:33 by manesioz

Hello again,

Since the parsing is layer-specific, I was wondering if its possible to associated each WayId to a list of NodeIds? This information does not seem to be available but maybe it's possible, any thoughts?

Something like this:

```python

{ 'osm_id': some_way_id, 'connected_nodes': [list of node id's associated with this way], ... } ```

Make generator to parse data for performance improvement with large files

opened on 2019-10-11 15:27:25 by manesioz

Since some *.osm.pbf files are quite large, do you think it would be possible to yield each row of data instead of appending it to a dict? So that parse_osm_pbf() would become a generator. This would be great for my use-case, if you want I can start a PR for this feature if you think its useful/feasible. @mikeqfu

Releases

2.1.2 2023-02-27 13:42:31

Notable changes since 2.1.1:

For more information and detailed specifications, check out PyDriosm 2.1.2 documentation.

2.1.1 2023-01-09 17:49:15

Notable changes since 2.1.0:

For more information and detailed specifications, check out PyDriosm 2.1.1 documentation.

2.1.0 2022-11-20 14:30:45

Note that this release introduces a highly modified version, which is not compatible with any previous versions.

Notable changes since 2.0.3:

For more information and detailed specifications, check out PyDriosm 2.1.0 documentation.

2.0.3 2021-04-25 18:46:00

Notable changes since 2.0.2:

For more information and detailed specifications, check out PyDriosm 2.0.3 documentation.

2.0.2 2020-11-24 00:11:26

Notable changes since 2.0.1:

For more information and detailed specifications, check out PyDriosm 2.0.2 documentation.

2.0.1 2020-11-19 17:21:51

Notable changes since 2.0.0:

Qian Fu

Research Fellow @UoB-BCRRE

GitHub Repository Homepage

openstreetmap python openstreetmap-data openstreetmap-protobuffer-format osm protocol-buffer-binary-format protobuf-binary-format pbf shapefile shp geofabrik bbbike postgresql