How to Install Nominatim on Void Linux
Nominatim is an open source tool for searching and geocoding addresses and places. In this tutorial, you will learn how to install Nominatim on Void Linux.
Prerequisites
Before you start installing Nominatim, you will need the following:
- A virtual or physical machine running Void Linux
- Access to the command line
Installation
Follow these steps to install Nominatim on Void Linux:
Open a Terminal window on your Void Linux system.
Update your system's package list:
sudo xbps-install -S
- Install the required dependencies:
sudo xbps-install -y autoconf automake bzip2 cmake curl g++ gcc git libbz2-dev libicu-dev libprotobuf-dev libxml2-dev libxslt1-dev make protobuf-compiler python3-setuptools python3-dev zlib1g-dev
- Clone Nominatim source code from GitHub:
git clone --recursive https://github.com/openstreetmap/Nominatim.git
- Navigate to the Nominatim source code directory:
cd Nominatim
- Configure the build:
./autogen.sh
./configure
- Build the software:
make
- Install Nominatim:
sudo make install
Configuration
Once you have installed Nominatim on your system, you will need to configure it.
- Download the data from OpenStreetMap:
sudo mkdir /srv/nominatim
sudo chown $USER /srv/nominatim
curl https://www.nominatim.org/data/wikipedia_article_categories.sql.gz -o wikipedia_article_categories.sql.gz
curl https://www.nominatim.org/data/wikipedia_redirects.sql.gz -o wikipedia_redirects.sql.gz
curl https://www.nominatim.org/data/wikipedia.sql.gz -o wikipedia.sql.gz
curl https://www.nominatim.org/data/shapefiles.tar.bz2 -o shapefiles.tar.bz2
sudo -u postgres createuser -s $USER
createdb nominatim
sudo -u postgres psql nominatim -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology; CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION postgis_tiger_geocoder;"
- Import the data into Nominatim:
./utils/setup.php --osm-file /path/to/osm.pbf --all --threads
./utils/setup.php --osm-file /path/to/osm.pbf --all --import-wikipedia-data
- Start the server:
sudo service nominatim start
- Test the server:
http://localhost/nominatim/reverse.php?lat=51.50643&lon=-0.12721&format=html
That's it! You have now successfully installed Nominatim on your Void Linux system.