readosm  1.0.0b
 All Data Structures Files Functions Variables Typedefs Macros Pages

Introduction

ReadOSM is a C open source library to extract valid data from within an Open Street Map input file. Such OSM files come in two different formats:

The ReadOSM design goals are:

ReadOSM is structurally simple and quite light-weight (typically about 20K of object code, stripped). ReadOSM has only two key dependencies:

Building and installing ReadOSM is straightforward:

./configure
make
make install

Linking ReadOSM to your own code is usually simple:

gcc my_program.c -o my_program -lreadosm

On some systems you may have to provide a slightly more complex arrangement:

gcc -I/usr/local/include my_program.c -o my_program \
  -L/usr/local/lib -lreadosm -lexpat -lz

ReadOSM also provides pkg-config support, so you can also do:

gcc `pkg-config --cflags readosm` my_program.c -o my_program `pkg-config --libs readosm`

I originally developed ReadOSM simply in order to allow the SpatiaLite's own CLI tools to acquire both OSM .osm and .pbf files indifferently. Anyway I feel that supporting OSM files import/parsing in a simple and easy way could be useful to many other developers, so I quickly decided to implement all this stuff as a self-standing library.

ReadOSM is licensed under the MPL tri-license terms: you are free to choose the best-fit license between:

Enjoy, and happy coding