3 Nominatim provides geocoding based on OpenStreetMap data. It uses a PostgreSQL
4 database as a backend for storing the data.
6 There are three basic parts to Nominatim's architecture: the data import,
7 the address computation and the search frontend.
9 The __data import__ stage reads the raw OSM data and extracts all information
10 that is useful for geocoding. This part is done by osm2pgsql, the same tool
11 that can also be used to import a rendering database. It uses the special
12 gazetteer output plugin in `osm2pgsql/src/output-gazetter.[ch]pp`. The result of
13 the import can be found in the database table `place`.
15 The __address computation__ or __indexing__ stage takes the data from `place`
16 and adds additional information needed for geocoding. It ranks the places by
17 importance, links objects that belong together and computes addresses and
18 the search index. Most of this work is done in PL/pgSQL via database triggers
19 and can be found in the files in the `sql/functions/` directory.
21 The __search frontend__ implements the actual API. It takes search
22 and reverse geocoding queries from the user, looks up the data and
23 returns the results in the requested format. This part is located in the
24 `nominatim-api` package. The source code can be found in `src/nominatim_api`.