Go to file
probonopd 6483ae0dcb
#include <unistd.h>
Fixes compilation on FreeBSD
Closes #72
2023-10-01 23:58:09 +02:00
.github Remove symlink from osmpbf to src, use osmpbf directly 2022-05-27 12:36:32 +02:00
include/osmpbf Set shared library version and bump version number to 1.5.0 2021-01-03 16:50:22 +01:00
osmpbf Remove symlink from osmpbf to src, use osmpbf directly 2022-05-27 12:36:32 +02:00
resources Convert WriteFileTest to unit test 2021-01-03 20:29:25 +01:00
src.java/crosby/binary BlockReaderAdapter: implement Closeable, Flushable 2021-01-04 20:34:57 +01:00
test.java/crosby/binary ReadFileTest: get rid of StringBuilder 2021-01-03 20:37:12 +01:00
tools #include <unistd.h> 2023-10-01 23:58:09 +02:00
.gitignore Modernize and clean up CMake configuration 2021-01-02 20:27:50 +01:00
CHANGELOG.md Release version 1.5.0 2021-01-06 14:47:22 +01:00
CMakeLists.txt CMake config: Remove unused line 2022-05-27 12:35:46 +02:00
LICENSE Rename COPYING.LESSER to LICENSE 2021-01-04 11:01:48 +01:00
README.md Show packaging status in README.md 2022-01-08 10:07:10 +01:00
build.sh Remove symlink from osmpbf to src, use osmpbf directly 2022-05-27 12:36:32 +02:00
build.xml Revert "Delete obsolete Ant build file" 2021-01-09 09:47:02 +01:00
magic add magic file 2011-06-05 11:51:11 +02:00
pom.xml Remove symlink from osmpbf to src, use osmpbf directly 2022-05-27 12:36:32 +02: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 Packaging status

Java Version

Building with Maven

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 ReadFileTest.

Building with Ant

If you can not use Maven for some reason you can use the Ant instead:

ant

This will build osmpbf.jar in the main directory.

This build is also used for Debian packaging.

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+.