Skip to content


Subversion checkout URL

You can clone with
Download ZIP
C++/Javascript framework for working with OSM files
C++ JavaScript
Pull request Compare This branch is 800 commits behind joto:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Osmium is a C++ framework for working with OSM data files. Osmium can read OSM
data in XML or binary format (PBF) and can call different handlers for each OSM

Available handlers include:
* Javascript handler (calls Javascript callbacks you provide)
* Multipolygon handler (assembles multipolygons from relations and ways)
* NodeLocationStore handler (stores node locations and builds way geometries from them)
* Statistics handler (does some general statistics)
* TagStats handler (creates statistics about tags for Taginfo (see

Of course, you can also write your own handlers.

Currently there are two applications build on top of and available with Osmium:
* tagstats - creates statistics about tags for Taginfo (see
* osmjs - calls your Javascript code, it can optionally assemble multipolygons for you


Different parts of Osmium and the applications build on top of it need
different libraries:

zlib (for PBF-Support)
    Debian/Ubuntu: zlib1g zlib1g-dev

shapelib (for Shapefile-Support in osmjs)
    Debian/Ubuntu: libshp1 libshp-dev

libsqlite3 (for HandlerTagStats/tagstats only)
    Debian/Ubuntu: libsqlite3-0 libsqlite3-dev

libgd (for HandlerTagStats/tagstats only)
    Debian/Ubuntu: libgd2-xpm libgd2-xpm-dev

libpng (for HandlerTagStats/tagstats only)
    Debian/Ubuntu: libpng12-0 libpng12-dev

Expat (for parsing XML files)
    Debian/Ubuntu: libexpat1 libexpat1-dev

GEOS (for HandlerMultipolygon)
    Debian/Ubuntu: libgeos-3.2.0 (older versions might work) libgeos-dev

Google sparsehash
    Debian/Ubuntu: libsparsehash-dev

Google V8 Javascript engine (for Javascript support)
    Debian/Ubuntu: libv8-2.2.18 libv8-dev

Google protocol buffers for PBF support (at least Version 2.3.0 needed)
    (Debian/Ubuntu: libprotobuf6, libprotobuf-dev, protobuf-compiler)
    Also see

You need to either install the Debian/Ubuntu packages (or equivalent for other
distributions) or install those libraries from source. Most libraries should be
available in all distributions. The Google libs (V8, protobuf, sparsehash)
are only available in newer distributions (Ubuntu since Maverick).


Doxyfile - Needed for building the Osmium C++ docs, call "make doc" to build.
include  - C/C++ include files. Most of Osmium is in those header files which
           are needed for building Osmium applications.
osmjs    - Osmium application "osmjs".
osmjs/js - Example Javascript handlers.
pbf      - Protobuf stuff needed for parsing PBF files.
src      - Osmium source code (C++-Files)
tagstats - Osmium application "tagstats".


To build everything just call "make" in the top-level directory. You can also
build the PBF part for itself by calling "make" in the pbf directory. To build
only the "osmjs" or "tagstats" application call "make" in those directories,

Call "make clean" in any of those places to clean up.

Call "make doc" in the top-level directory to build the Osmium C++ docs.

Call "make install" to install applications.

Something went wrong with that request. Please try again.