Go to file
Simon Legner de663a3de3 ReadFileTest: get rid of StringBuilder 2021-01-03 20:37:12 +01:00
.github Update Github actions: Use cmake to build, add macOS and Windows 2021-01-02 20:28:25 +01:00
include/osmpbf Set shared library version and bump version number to 1.5.0 2021-01-03 16:50:22 +01:00
resources Convert WriteFileTest to unit test 2021-01-03 20:29:25 +01:00
src CMake: Use single set_target_properties() command 2021-01-03 17:13:28 +01:00
src.java/crosby/binary Move Java test files to test.java/ 2021-01-03 19:55:34 +01:00
test.java/crosby/binary ReadFileTest: get rid of StringBuilder 2021-01-03 20:37:12 +01:00
tools Set destination for installs explicitly 2021-01-03 15:26:14 +01:00
.gitignore Modernize and clean up CMake configuration 2021-01-02 20:27:50 +01:00
CHANGELOG.md Add deprecation notice for Makefiles 2021-01-03 18:20:16 +01:00
CMakeLists.txt Set shared library version and bump version number to 1.5.0 2021-01-03 16:50:22 +01:00
COPYING Include GPLv3 text 2015-06-23 17:08:59 +01:00
COPYING.LESSER Include GPLv3 text 2015-06-23 17:08:59 +01:00
README.md Add deprecation notice for Makefiles 2021-01-03 18:20:16 +01:00
magic add magic file 2011-06-05 11:51:11 +02:00
osmpbf Modernize and clean up CMake configuration 2021-01-02 20:27:50 +01:00
pom.xml Move Java test files to test.java/ 2021-01-03 19:55:34 +01:00

README.md

OSMPBF

https://github.com/openstreetmap/OSM-binary

Osmpbf is a Java/C library to read and write OpenStreetMap PBF files. PBF (Protocol buffer Binary Format) is a binary file format for OpenStreetMap data that uses Google Protocol Buffers as low-level storage.

For more information see https://wiki.openstreetmap.org/wiki/PBF_Format .

Note that this is a low-level library that does only part of the encoding/decoding needed for actually writing/reading an OSM PBF file. For something more complete see libosmium.

Github Actions C Build Status Github Actions Java Build Status

Java Version

We publish the Java library to Maven Central:

<dependency>
  <groupId>org.openstreetmap.pbf</groupId>
  <artifactId>osmpbf</artifactId>
  <version>1.5.0</version>
</dependency>

To build the Java library run:

mvn package

For a Java usage example, see src.java/crosby/binary/test/ReadFileExample.java

C++ Version

(Earlier versions used Makefiles for building. Please switch to the CMake-based build, the Makefiles are deprecated and will be removed in a future version.)

To compile:

mkdir build && cd build
cmake ..
make

To install:

make install

There is a tool named osmpbf-outline that shows a debug output of the contents of a PBF file. To run it:

tools/osmpbf-outline osm-file.osm.pbf

Using the C++ Library

To include in your program use:

#include <osmpbf/osmpbf.h>

and link with:

-pthread -lz -lprotobuf -losmpbf

License

The .proto definition files and osmpbf.h are licensed under the MIT license. The other source code is licensed under the LGPL v3+.