]> git.openstreetmap.org Git - nominatim.git/blob - docs/develop/overview.md
small typos and wording in the API docs
[nominatim.git] / docs / develop / overview.md
1 # Basic Architecture
2
3 Nominatim provides geocoding based on OpenStreetMap data. It uses a Postgresql
4 database as a backend for storing the data.
5
6 There are three basic parts to Nominatim's architecture: the data import,
7 the address computation and the search frontend.
8
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/output-gazetter.[ch]pp`. The result of
13 the import can be found in the database table `place`.
14
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/pqSQL via database triggers
19 and can be found in the file `sql/functions.sql`.
20
21 The __search frontend__ implements the actual API. It takes queries for
22 search and reverse geocoding queries from the user, looks up the data and
23 returns the results in the requested format. This part is written in PHP
24 and can be found in the `lib/` and `website/` directories.