• Stars
    star
    193
  • Rank 201,081 (Top 4 %)
  • Language
    Java
  • License
    GNU Lesser Genera...
  • Created over 14 years ago
  • Updated 8 months ago

Reviews

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

Repository Details

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

More Repositories

1

iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
JavaScript
3,369
star
2

openstreetmap-website

The Rails application that powers OpenStreetMap
Ruby
2,188
star
3

osm2pgsql

OpenStreetMap data to PostgreSQL converter
C++
1,390
star
4

osmosis

Osmosis is a command line Java application for processing OSM data.
Java
672
star
5

mod_tile

Renders map tiles with mapnik and serves them using apache
C++
287
star
6

merkaartor

Home of Merkaartor, an openstreetmap mapping program.
C++
280
star
7

id-tagging-schema

🆔🏷 The presets and other tagging data used by the iD editor
JavaScript
158
star
8

mapnik-stylesheets

Mirror of the mapnik stylesheets formerly used on OpenStreetMap.org
Python
153
star
9

leaflet-osm

OpenStreetMap plugin for Leaflet
JavaScript
110
star
10

operations

OSMF Operations Working Group issue tracking
99
star
11

chef

Chef configuration management repo for configuring & maintaining the OpenStreetMap servers.
Ruby
95
star
12

tirex

Tirex tile queue manager. A drop-in replacement for renderd.
Perl
65
star
13

openstreetmap-mirror

Scripts to mirror remote repositories to http://github.com/openstreetmap
Shell
60
star
14

potlatch2

Potlatch 2 OpenStreetMap Editor
ActionScript
50
star
15

owg-website

The website for the OSMF Operations Working Group (OWG)
CSS
50
star
16

osmembrane

OSMembrane is a GUI front-end for “Osmosis” used by the OpenStreetMap project.
Java
42
star
17

map-icons

Mirror of the map icons used on OpenStreetMap.org
HTML
40
star
18

mkgmap

Mirror of mkgmap's Subversion repository
Java
32
star
19

tile-attribution

This repository is used for reporting and tracking sites which are using tile.openstreetmap.org tiles but without attributing OpenStreetMap. The sites are tracked in the issue tracker.
Ruby
32
star
20

osmdbt

OSM Database Replication Tools
C++
21
star
21

cgimap

Mirror of CGImap, the optimized implementation of the OpenStreetMap "/map" API call. PRs via: https://github.com/zerebubuth/openstreetmap-cgimap
C++
19
star
22

dns

OpenStreetMap DNS
JavaScript
15
star
23

gosmore

Mirror of Gosmore's Subversion repository
C++
13
star
24

stateofthemap-2019

State of the Map 2019 website
HTML
11
star
25

stateofthemap-2022

CSS
11
star
26

lane-icons

⬆️ SVG icons for common lane markings
11
star
27

svn-archive

Archived git conversion of svn.openstreetmap.org
Java
9
star
28

stateofthemap-2020

State of the Map 2020 website
CSS
9
star
29

shp2osm

Mirror of the shp2osm Subversion repository
Python
9
star
30

osm2pgsql-website

Website for the osm2pgsql project
SCSS
8
star
31

potlatch

Mirror of Potlatch's subversion repository
ActionScript
7
star
32

gpx-updater

Retrieve new OSM GPS tracks as they are uploaded, and invalidate cached tiles
Perl
7
star
33

planetdump

Obsolete OpenStreetMap Planet Dump Generator - Replaced by https://github.com/zerebubuth/planet-dump-ng
C
6
star
34

splitter

Mirror of splitter's Subversion repository
Java
6
star
35

stateofthemap-2018

State of the Map 2018 website
HTML
6
star
36

beboj

Online OpenStreetMap editor (pre-alpha, discontinued)
Java
5
star
37

stateofthemap-website

State of the Map website resources
HTML
5
star
38

gpx-import

GPX Importer
C
4
star
39

stateofthemap-2016

State of the Map 2016
CSS
4
star
40

openstreetmap-license-change

Algorithm for OpenStreetMap ODbL transition.
Ruby
3
star
41

stateofthemap-2017

State of the Map 2017 website
HTML
3
star
42

stateofthemap-2024

State of the Map 2024 website
CSS
3
star
43

quad_tile

Native C implementation of quad_tile functions from OpenStreetMap bundled as a gem
Ruby
2
star
44

tilelog

Python
2
star
45

mediawiki-skins-osmf

OSMF Skin for MediaWiki
CSS
2
star
46

prometheus-exporters

Ruby
2
star
47

osmtaginfo

Mediawiki extension for taginfo.openstreetmap.org
PHP
2
star
48

irc-website

irc.openstreetmap.org website
HTML
2
star
49

svn-website

Minimal redirector for the svn.openstreetmap.org to the archive
Dockerfile
1
star
50

opengeodata-static

Historical OpenGeoData static content
1
star
51

hot.openstreetmap.org-website

container and builder for hot.openstreetmap.org website
Dockerfile
1
star
52

trac-website

Minimal redirector for the trac.openstreetmap.org to the archived tickets
Dockerfile
1
star
53

dmca-website

OpenStreetMap's DMCA notice website
PHP
1
star
54

stateofthemap-2021

State of the Map 2021 website
CSS
1
star