• Stars
    star
    292
  • Rank 142,152 (Top 3 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created about 10 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python bindings for libosmium

pyosmium

Provides Python bindings for the Libosmium C++ library, a library for working with OpenStreetMap data in a fast and flexible manner.

Github Actions Build Status

Installation

Pyosmium works with Python >= 3.6. Pypy is known to not work.

Using Pip

The recommended way to install pyosmium is via pip:

pip install osmium

We provide binary wheels for Linux and Windows 64 for all actively maintained Python versions.

For other versions, a source wheel is provided. Make sure to install all external dependencies first. On Debian/Ubuntu-like systems, the following command installs all required packages:

sudo apt-get install build-essential cmake libboost-dev \
                     libexpat1-dev zlib1g-dev libbz2-dev

Installing from source

Prerequisites

pyosmium has the following dependencies:

Compiling from Source

Get the latest versions of libosmium, protozero and pybind11. It is recommended that you put them in a subdirectory contrib. You can also set custom locations with LIBOSMIUM_PREFIX, PROTOZERO_PREFIX and PYBIND11_PREFIX respectively.

To use a custom boost installation, set BOOST_PREFIX.

To compile the bindings during development, you can use build. On Debian/Ubuntu-like systems, install python3-build, then run:

python3 -m build -w

To compile and install the bindings, run

pip install [--user] .

Examples

The example directory contains small examples on how to use the library. They are mostly ports of the examples in Libosmium and osmium-contrib.

Testing

There is a small test suite in the test directory. This provides regression test for the python bindings, it is not meant to be a test suite for Libosmium.

You'll need the Python pytest module. On Debian/Ubuntu install the package python3-pytest.

The suite can be run with:

pytest test

Documentation

To build the documentation you need Sphinx and the autoprogram extension On Debian/Ubuntu install python-sphinx sphinxcontrib-autoprogram or python3-sphinx python3-sphinxcontrib.autoprogram.

First compile the bindings as described above and then run:

cd doc
make html

For building the man pages for the tools run:

cd doc
make man

Bugs and Questions

If you find bugs or have feature requests, please report those in the github issue tracker.

For general questions about using pyosmium you can use the OSM development mailing list or ask on OSM help.

License

Pyosmium is available under the BSD 2-Clause License. See LICENSE.TXT.

Authors

Sarah Hoffmann ([email protected])

More Repositories

1

osmium-tool

Command line tool for working with OpenStreetMap data based on the Osmium library.
C++
462
star
2

libosmium

Fast and flexible C++ library for working with OpenStreetMap data.
C++
438
star
3

node-osmium

Fast and flexible Javascript library for working with OpenStreetMap data.
C++
137
star
4

osmcoastline

Extracts coastline data from OpenStreetMap planet file.
C++
104
star
5

osm-testdata

OpenStreetMap Test Data.
Ruby
27
star
6

osm-gis-export

Export OSM data to GIS formats like Shapefiles, Spatialite or PostGIS.
C++
21
star
7

osmium-contrib

Mixed more or less useful programs using the Osmium library
C++
20
star
8

osmcode.github.io

osmcode.org website
HTML
11
star
9

osmium-filter

Fast filter for OSM data
C++
9
star
10

osmium-surplus

Collection of assorted small programs based on the Osmium framework
C++
7
star
11

osm-data-model-tools

OSM Data Model Tools
C++
6
star
12

osm-postgresql-experiments

Experimental code for importing OSM data into PostgreSQL/PostGIS
C++
6
star
13

mercator-projection

Different implementations of Mercator projection
C++
5
star
14

osm-area-tools

OSM Area Tools
C++
5
star
15

osm-data-anomaly-detection

Various programs to detect anomalies in OSM data.
C++
4
star
16

osm-data-validation

Tools for validating OSM database integrity
CMake
4
star
17

osm-tags-transform

Transform tags in OSM files using Lua code
CMake
3
star
18

pyosmium-wheel-build

Shell
2
star
19

osmium-suite

For developers of the Osmium suite of software
Shell
2
star
20

osmium-proj

Code for using PROJ 6 and above with Osmium
C++
1
star
21

osmium-gentoo

Scripts for packaging Osmium for Gentoo
Shell
1
star