Skip to main content

Low-level Python library to interact with OSM PBF files

Project description

esy.osm.pbf is a low-level Python library to interact with OpenStreetMap data files in the Protocol Buffers (PBF) format.

Usage

To count the amount of parks in the OpenStreetMap Andorra .pbf file (at least according to a copy from geofabrik), do this:

First download a copy of the andorra dataset:

>>> import os, urllib.request
>>> if not os.path.exists('andorra.osm.pbf'):
...     filename, headers = urllib.request.urlretrieve(
...         'https://download.geofabrik.de/europe/andorra-190101.osm.pbf',
...         filename='andorra.osm.pbf'
...     )

Open the file and iterate over all entry and count those with a tag leisure having a value of park.

>>> import esy.osm.pbf
>>> osm = esy.osm.pbf.File('andorra.osm.pbf')
>>> len([entry for entry in osm if entry.tags.get('leisure') == 'park'])
21

Design, Development & Contributing

Design and development notes are available in esy.osm.pbf.test.

We would be happy to accept contributions via merge requests, but due to corporate policy we can only accept contributions if you have send us the signed contributor license agreement.

Contact

Please use the projects issue tracker to get in touch.

Team

esy.osm.pbf is developed by the DLR Institute of Networked Energy Systems in the departement for Energy Systems Analysis (ESY).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esy-osm-pbf-0.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esy_osm_pbf-0.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file esy-osm-pbf-0.1.tar.gz.

File metadata

  • Download URL: esy-osm-pbf-0.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.9.6 requests/2.28.1 setuptools/63.2.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.7

File hashes

Hashes for esy-osm-pbf-0.1.tar.gz
Algorithm Hash digest
SHA256 04dedf373091e471fcfa36547d6b35aedd4f91107268fc8dbea085df570d30c2
MD5 80072083c423d5b03008a919c9115516
BLAKE2b-256 e8206f85fb5f6222abb366c2b82dc2130467d920b362f8256607c4ef384e4f03

See more details on using hashes here.

File details

Details for the file esy_osm_pbf-0.1-py3-none-any.whl.

File metadata

  • Download URL: esy_osm_pbf-0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.9.6 requests/2.28.1 setuptools/63.2.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.7

File hashes

Hashes for esy_osm_pbf-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68257ba66737fa57a3c58cae1e10f11c28fd3cfa579963481b930febdff06b7a
MD5 21b166375aa639b75f97d26198e6345e
BLAKE2b-256 1b18ea17ca4b9426f809c37c0e49d9b799470877a0fc15ce72c9e631a379d0b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page