Need help with OSMNames?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

261 Stars 49 Forks GNU General Public License v2.0 487 Commits 31 Opened issues


Data for place names from OpenStreetMap prepared for fulltext search. Downloadable. Ranked. With bbox and hierarchy. Ready for geocoding.

Services available


Need anything else?

Contributors list

OSM Names Build Status Documentation Status

Database of geographic place names with hierarchy and bounding boxes from OpenStreetMap for full text search downloadable for free:


If you are a programmer or a documenter and have a pull request, feel free to do so.

If you are a user and have questions, we're sorry that we can't give individual support. Pls. ask support questions over at Stack Overflow .

Target of OSM Names

  • Downloadable gazeteer data a la but each record has bounding box and an importance rank known from Nominatim
  • Data are derived primarily from OpenStreetMap
  • The data format is simple to use tab-delimited text in utf8 encoding (as First line has column names.
  • Different type of records are stored in different files (download and index just what you need, sometimes you don't need POIs or addresses with house numbers)
  • Possible to generate from a country specific extract of Open Street Map (together with vector tiles)

Benefits of OSM Names

  • Direct indexing via fulltext search engines (SphinxSearch, ElasticSearch, etc.)
  • Simple process to get a basic search in place names on a map within minutes
  • Downloading the basic gazeteer data from OSM in usable format is problematic now (a need to process large OSM Planet files)

Sample search server

  • Powered by super fast open-source fulltext Sphinxsearch - inspired by Swiss GeoAdmin search service
  • JSON/JSONP API similar to Nominatim:
  • Ready to use via Docker in minutes

Data format of tsv export of OSMNames

Details about the output format of OSMNames can be found in the documentation.


The world extract can be downloaded here:

If you want to extract only the information for a specific country, you can use the following command

awk -F $'\t' 'BEGIN {OFS = FS}{if (NR!=1) {  if ($16 =="[country_code]")  { print}    } else {print}}' planet-latest.tsv > countryExtract.tsv

where country_code is the ISO-3166 2-letter country code.

Get Started

The OSM PBF data dump will be download when starting the process. By default it will download the entire world. If you want to change this, edit the

file and change
. Alternatively, you can manually place a PBF file in the
directory and define
with the filename. (For example, to process only a specific country you can use the PBF-files from

We can now start the process with:

docker-compose run --rm osmnames

This will call the script

in the docker container, which will execute following steps: * Initialize the database * Download the pbf * Download and import the wikipedia dump * Import the pbf file to the database * Export names and their bounding boxes to a TSV datasets

If you run the command a second time, some steps will be skipped. To run it from scratch, remove the postgres container, which will destroy the database.

docker-compose kill postgres
docker-compose rm postgres

The process will create a file

with all the geonames and
with the house numbers. To use the export with osmnames-sphinxsearch, have a look at the corresponding section in the readme. A simple command to get started is:
docker run --rm --name klokantech-osmnames-sphinxsearch -v `pwd`/planet-latest_geonames.tsv.gz:/data/input/data.tsv.gz -p 80:80 klokantech/osmnames-sphinxsearch

Afterwards you can access the web interface in a browser with




To run the tests execute following command:

docker-compose run --rm osmnames bash

SQL Style Guide

To have a consistent style of SQL code, try to follow this guideline:

More Documentation

The full documentation of the project can be found here:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.