BASEURL="https://download.geofabrik.de"
DOWNCOUNTRYPOSTFIX="-latest.osm.pbf"
-
+
+### Setting up multiple regions
+
!!! tip
- If your database already exists and you want to add more countries, replace the setting up part
+ If your database already exists and you want to add more countries,
+ replace the setting up part
`${SETUPFILE} --osm-file ${UPDATEDIR}/tmp/combined.osm.pbf --all 2>&1`
with `${UPDATEFILE} --import-file ${UPDATEDIR}/tmp/combined.osm.pbf --index --index-instances N 2>&1`
where N is the numbers of CPUs in your system.
-### Setting up multiple regions
-
Run the following command from your Nominatim directory after configuring the file.
bash ./utils/import_multiple_regions.sh
then you can resume with the following command:
```sh
-./utils/setup.php --index --create-search-indices --create-country-names
+nominatim import --continue indexing
```
If the reported rank is 26 or higher, you can also safely add `--index-noanalyse`.
If it happened during index creation you can try rerunning the step with
```sh
-./utils/setup.php --create-search-indices --ignore-errors
+nominatim import --continue indexing
```
Otherwise it's best to start the full setup from the beginning.
### I see the error: "function transliteration(text) does not exist"
-Reinstall the nominatim functions with `setup.php --create--functions`
+Reinstall the nominatim functions with `nominatim refresh --functions`
and check for any errors, e.g. a missing `nominatim.so` file.
### I see the error: "ERROR: mmap (remap) failed"
### nominatim UPDATE failed: ERROR: buffer 179261 is not owned by resource owner Portal
-Several users [reported this](https://github.com/openstreetmap/Nominatim/issues/1168) during the initial import of the database. It's
+Several users [reported this](https://github.com/openstreetmap/Nominatim/issues/1168)
+during the initial import of the database. It's
something PostgreSQL internal Nominatim doesn't control. And PostgreSQL forums
suggest it's threading related but definitely some kind of crash of a process.
Users reported either rebooting the server, different hardware or just trying
### I forgot to delete the flatnodes file before starting an import.
That's fine. For each import the flatnodes file get overwritten.
-See [https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage]()
+See [https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage](https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage)
for more information.
!!! tip
If you forgot to download the wikipedia rankings, you can also add
importances after the import. Download the files, then run
- `./utils/setup.php --import-wikipedia-articles`
- and `./utils/update.php --recompute-importance`.
+ `./nominatim refresh --wiki-data --importance`.
### Great Britain, USA postcodes
About half of the data in Nominatim's database is not really used for serving
the API. It is only there to allow the data to be updated from the latest
changes from OSM. For many uses these dynamic updates are not really required.
-If you don't plan to apply updates, the dynamic part of the database can be
-safely dropped using the following command:
+If you don't plan to apply updates, you can run the import with the
+`--no-updates` parameter. This will drop the dynamic part of the database as
+soon as it is not required anymore.
+
+You can also drop the dynamic part later using the following command:
```
-./utils/setup.php --drop
+./nominatim freeze
```
Note that you still need to provide for sufficient disk space for the initial
from the **build directory** to start the import:
```sh
-./utils/setup.php --osm-file <data file> --all 2>&1 | tee setup.log
+./nominatim import --osm-file <data file> 2>&1 | tee setup.log
```
### Notes on full planet imports
Run this script to verify all required tables and indices got created successfully.
```sh
-./utils/check_import_finished.php
+./nominatim check-database
```
-### Setting up the website
-
-Run the following command to set up the configuration file for the API frontend
-`settings/settings-frontend.php`. These settings are used in website/*.php files.
-
-```sh
-./utils/setup.php --setup-website
-```
-!!! Note
- This step is not necessary if you use `--all` option while setting up the DB.
+### Testing the installation
Now you can try out your installation by running:
of forward geocoding in particular under high load. To recompute word counts run:
```sh
-./utils/update.php --recompute-word-counts
+./nominatim refresh --word-counts
```
This will take a couple of hours for a full planet installation. You can
[special key phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
you also need to enable these key phrases like this:
- ./utils/specialphrases.php --wiki-import > specialphrases.sql
+ ./nominatim special-phrases --from-wiki > specialphrases.sql
psql -d nominatim -f specialphrases.sql
Note that this command downloads the phrases from the wiki link above. You
1. Get preprocessed TIGER 2019 data and unpack it into the
data directory in your Nominatim sources:
- cd Nominatim/data
wget https://nominatim.org/data/tiger2019-nominatim-preprocessed.tar.gz
tar xf tiger2019-nominatim-preprocessed.tar.gz
2. Import the data into your Nominatim database:
- ./utils/setup.php --import-tiger-data
+ ./nominatim add-data --tiger-data tiger
3. Enable use of the Tiger data in your `.env` by adding:
4. Apply the new settings:
```sh
- ./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
+ ./nominatim refresh --functions
```
SQL statements should be executed from the PostgreSQL commandline. Execute
`psql nominatim` to enter command line mode.
+## 3.6.0 -> master
+
+### Introducing `nominatim` command line tool
+
+The various php utilities have been replaced with a single `nominatim`
+command line tool. Make sure to adapt any scripts. There is no direct 1:1
+matching between the old utilities and the commands of nominatim CLI. The
+following list gives you a list of nominatim sub-commands that contain
+functionality of each script:
+
+* ./utils/setup.php: `import`, `freeze`, `refresh`
+* ./utils/update.php: `replication`, `add-data`, `index`, `refresh`
+* ./utils/specialphrases.php: `special-phrases`
+* ./utils/check_import_finished.php: `check-database`
+* ./utils/warm.php: `warm`
+* ./utils/export.php: `export`
+
+Try `nominatim <command> --help` for more information about each subcommand.
+
+`./utils/query.php` no longer exists in its old form. `nominatim search`
+provides a replacement.
+
## 3.5.0 -> 3.6.0
### Change of layout of search_name_* tables
# Updating the Database
There are many different ways to update your Nominatim database.
-The following section describes how to keep it up-to-date with Pyosmium.
-For a list of other methods see the output of `./utils/update.php --help`.
+The following section describes how to keep it up-to-date using
+an [online replication service for OpenStreetMap data](https://wiki.openstreetmap.org/wiki/Planet.osm/diffs)
+For a list of other methods to add or update data see the output of
+`nominatim add-data --help`.
!!! important
If you have configured a flatnode file for the import, then you
To set up the update process now run the following command:
- ./utils/update.php --init-updates
+ ./nominatim replication --init
It outputs the date where updates will start. Recheck that this date is
what you expect.
-The `--init-updates` command needs to be rerun whenever the replication service
-is changed.
+The `replication --init` command needs to be rerun whenever the replication
+service is changed.
#### Updating Nominatim
The following command will keep your database constantly up to date:
- ./utils/update.php --import-osmosis-all
-
-(Note that even though the old name "import-osmosis-all" has been kept for
-compatibility reasons, Osmosis is not required to run this - it uses pyosmium
-behind the scenes.)
+ ./nominatim replication
If you have imported multiple country extracts and want to keep them
up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions
suited for these kinds of queries.
That said if you installed your own Nominatim instance you can use the
-`/utils/export.php` PHP script as basis to return such lists.
+`nominatim export` PHP script as basis to return such lists.
## Regular updating calculated postcodes
The script to rerun the calculation is
-`build/utils/update.php --calculate-postcodes`
+`nominatim refresh --postcodes`
and runs once per night on nominatim.openstreetmap.org.