Sign inSign up

stadtnavi/nominatim

By stadtnavi

•Updated over 5 years ago

Image
0

558

stadtnavi/nominatim repository overview

⁠Nominatim Docker (Nominatim version 3.4)

  1. Build the docker image
docker build -t nominatim .
  1. Download the required data, initialize the database and start nominatim in one go
  docker run -it --rm \
    -e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
    -e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
    -e IMPORT_WIKIPEDIA=true
    -p 5432:5432
    -p 8080:8080
    --name nominatim 
    nominatim

The configuration variables mean the following:

  • PBF_URL: Which OSM extract to download. Check https://download.geofabrik.de⁠
  • REPLICATION_URL: Where to get updates from. Also availble from Geofabrik.
  • IMPORT_WIKIPEDIA: Whether to import the Wikipedia article and redirect dumps. On a beefy 10 core server this takes around 10 minutes.

The port 8080 is the nominatim website port and 5432 is the Postgres port, which you may or may not want to expose.

⁠Persistent container data

There are two folders inside the contain the can be persistet across container creation and removal.

  • /app/ holds the state about whether the import was succesful and general nominatim config
  • /var/lib/postgresql/11/main is the storage location of the Postgres database

So if you want to be able to kill your container and start it up again with all the data still present use the following command:

  docker run -it --rm \
    -e PBF_URL=http://download.geofabrik.de/europe/monaco-latest.osm.pbf \
    -e REPLICATION_URL=http://download.geofabrik.de/europe/monaco-updates/ \
    -e IMPORT_WIKIPEDIA=false
    -v nominatim-data:/app 
    -v nominatim-postgres:/var/lib/postgresql/11/main
    -p 5432:5432
    -p 8080:8080
    --name nominatim 
    nominatim

⁠Update

Full documentation for Nominatim update available here⁠. For a list of other methods see the output of:

docker exec -it nominatim sudo -u postgres ./src/build/utils/update.php --help

The following command will keep your database constantly up to date:

docker exec -it nominatim sudo -u postgres ./src/build/utils/update.php --import-osmosis-all

If you have imported multiple country extracts and want to keep them up-to-date, have a look at the script in issue #60⁠.

Tag summary

Content type

Image

Digest

Size

831.2 MB

Last updated

over 6 years ago

docker pull stadtnavi/nominatim