From OpenStreetMap Wiki
Jump to navigation Jump to search

osmgeoref (German title OSM-Georeferenzierung – Effiziente Georeferenzierung mit OpenStreetMap-Daten) is a small open-source project concerning efficient geocoding. The goal was to create a geocoding system which does not require much CPU power and does not have special prerequisites. This means particularly it does not need a database system.

Since the author lives in Germany, this country has been chosen as a test area. That does not necessarily mean of course that the developed software would not be able to use other regions as a geodata source.

The software system consists of two parts: data preparation and geocoding.

GNU Affero General Public License version 3 licensed according to the source code headers.

Data Preparation

The actual geocoding algorithm needs to be based on data structures which allow fast access to all the information required. The data preparation converts OSM raw data and writes them into these structures. The generated file has .ogb (OSM geobase) format.

Osmgeoref dataflow.pdf

The data preparation is done by a shell script named preparation.sh. Several C programs are called by this script:

  • osmconvert: scissoring and transforming osm files
  • osmfilter: filtering of OSM files
  • osmrelpoly: transforming OSM relations into border polygons
  • osmassignpoly: assigning border polygons to OSM node objects
  • osmgeobase: calculating and completing OSM address data


The actual conversion of house addresses into geocoordinates is done in the program osmposition.

Speed tests showed typical geocoding times at about 4 µs per enquiry on a virtual machine with 4 GiB RAM (hardware: i7 computer with SSD).


All software of this project can be downloaded from here:


Detailed Information about the software can be found within the source code files. The binaries offer rudimentary help via options -h or --help. Further explanations are available at Universitätsbibliothek Hagen (German only). Please see chapter 6 for Data Preparation and chapter 7 for Geocoding.