Go to file
Jochen Topf e0d4b58e66
Merge pull request #47 from simon04/github-actions-java-protoc
GitHub Actions: use protobuf-compiler for Java
2020-10-20 10:16:07 +02:00
.github/workflows GitHub Actions: use protobuf-compiler for Java 2020-10-20 09:39:42 +02:00
debian Version 1.3.3 released 2014-03-15 16:11:32 +01:00
include/osmpbf License the .proto and header files under MIT 2019-07-11 13:59:00 -07:00
redhat Updated redhat spec and Makefile 2014-03-26 18:45:48 +04:00
resources Java file read demonstration, to help people getting started. 2012-10-19 23:00:21 +01:00
src Merge branch 'master' into optimize_for-LITE_RUNTIME 2020-08-22 16:23:06 +02:00
src.java/crosby/binary Fix line endings (CRLF->LF), remove spaces at end of lines 2013-09-02 20:44:02 +02:00
tools Disable deprecated optimize_for = LITE_RUNTIME option. 2020-03-22 08:12:06 +01:00
.gitignore Deploy to Maven Central 2020-10-20 01:27:44 +02:00
CMakeLists.txt More compilation fixes 2013-07-22 23:13:26 +06: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 Deploy to Maven Central 2020-10-20 01:27:44 +02:00
ReleaseNotes.txt Version 1.3.3 released 2014-03-15 16:11:32 +01:00
build.sh Protobufs and common Java code for binary format. 2010-08-25 11:40:06 -05:00
build.xml Fix build.xml to work with Ubuntu 12.04 where protobuf jar has different name 2014-03-30 21:28:14 +02:00
magic add magic file 2011-06-05 11:51:11 +02:00
pom.xml Deploy to Maven Central 2020-10-20 01:27:44 +02:00

README.md

OSMPBF

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 .

Java Version

We publish the Java library to Maven Central:

<dependency>
  <groupId>org.openstreetmap.pbf</groupId>
  <artifactId>osmpbf</artifactId>
  <version>1.4.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

To compile:

make -C src

To install:

make -C src install

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

make -C tools

Using the C Library

To include in your program use:

#include <osmpbf/osmpbf.h>

and link with:

-pthread -lz -lprotobuf-lite -losmpbf

Debian/Ubuntu Packages

To build the Debian/Ubuntu packages:

debuild -I -us -uc

To install the Debian/Ubuntu packages:

sudo dpkg --install ../libosmpbf-dev_*.deb
sudo dpkg --install ../libosmpbf-java_*.deb
sudo dpkg --install ../osmpbf-bin_*.deb

To clean up after:

debclean

License

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