This is the backend of the new OSM Inspector Address view. OSM Inspector is a quality assurance service for OpenStreetMap data by the german consulting company Geofabrik GmbH and can be found at http://tools.geofabrik.de/osmi. This software was written by Lukas Toggenburger as part of a project thesis for his master studies. It makes heavy use of libosmium (https://github.com/osmcode/libosmium) written by Jochen Topf.
Casual users interested in seeing address data may find the hosted version at http://tools.geofabrik.de/osmi much more useful than running this software. A WxS is also available there, see http://wiki.openstreetmap.org/wiki/OSM_Inspector/WxS on how to use it.
If you are indeed interested in the backend, e.g. to see usage of libosmium in a bigger project, you have come to the right place. This software will take OSM data (XML or PBF; planet file or parts of it) data as input and produce a SpatiaLite file as output. The output format is easily changeable due to GDAL/OGR being utilized to hold and write data.
A file can be processed like this:
./osmi planet-latest.osm.pbf
By default a file called out.sqlite is written. If a second parameter is given, the name of the output file can be changed:
./osmi planet-latest.osm.pbf my-output-file.sqlite
An existing file will not be overwritten, the program will be aborted instead.
To improve overall calculation speed, spatial indices are not calculated while writing the SpatiaLite file. Instead you are supposed to call
./create_spatial_indices.sh out.sqlite
to add them afterwards.
The software was tested on Ubuntu but probably runs under other Unix variants (incl. Mac OS X) as well.
You will need a C++11 compiler and libosmium to compile the software. libosmium itself comes with a list of prerequisites, which you can find at https://github.com/osmcode/libosmium#prerequisites.
Compile using GCC:
make
Or compile using clang:
CXX=clang++ make
The compiled executable osmi is a standalone application and needs no installation.
If you have never used clang before, you should give it a try. It compiles (at least this software) slightly faster and gives better understandable error messages if you mess things up.
This software is available under the Boost Software License 1.0, see http://www.boost.org/LICENSE_1_0.txt.
Lukas Toggenburger ( firstname.lastname@htwchur.ch )