a.Required Software:
in the The software that the Ubuntu system compiles to perform the Nominatim software system must be installed:
1.GCC compiler
2.postgresql Database
3.proj4
4.geos
5.postgis
6.PHP
7.php-pgsql
8.PEAR::D b
9.protobuf
10.wget
11.osmis
two.install the necessary packages
Apt-get Install build-essential Libxml2-dev libgeos-dev Libpq-devlibbz2-dev
Apt-get install gcc proj-bin libgeos-c1 osmis
Apt-get install php5 php-pear php5-pgsql Php5-json php-db
Apt-get Install PostgreSQL PostGIS Postgresql-contribpostgresql-9.3-postgis
because the imported geographic data format is PBF, you need to install PBF support software
Apt-get Install Libprotobuf-c0-dev Protobuf-c-compiler
in the Debian system,the GEOS is required to have a package
Apt-get Install Libgeos++-dev
PostgreSQLConfiguration:
Open The postgresql.conf file in /etc/postgresql/9.3/main , setting for example the following properties:
Fsync = Off
Full_page_writes = Off
The detailed commands are:
sudo vim/etc/postgresql/9.3/main in the postgresql.conf
three.installationNominatim1.Download Source code
wget http://www.nominatim.org/release/Nominatim-2.2.0.tar.bz2
Tar xvf nominatim-2.2.0.tar.bz2
CD Nominatim-2.2.0
./sutogen.sh
./configure
Make
2.in theNominatimin the folderSettingsNew in Folderlocal.phpfiles,
Configuration such as the following:
<?php
Paths
@define (' const_postgresql_version ', ' 9.3 ');
@define (' const_postgis_version ', ' 2.1 ');
@define (' Const_website_baseurl ', ' http://localhost/nominatim/');
3.NewPostgresUser account:
1. Create a new import account
AddUser < own username,example:mypg>
passwd <password>
Su–postgres
Psql-template1
The interface switches to the interactive interface of the database, typing such as the following command:
CREATE USER < own username,Example:mypg>with PASSWORD <PASSWORD>
exit the database interaction interface, typing command:\q
Switch to root
New Site User:
CREATEUSER-SDR Www-data
to change Read permissions for Nominatim:
chmod +x/soft_src
chmod +x/soft_src/nominatim-2.2.0
chmod +x/soft_src/nominatim-2.2.0/module
pour the downloaded OSM data, and index it:
Download data address for (PBF format):
http://download.geofabrik.de/openstreetmap/
import PBF data:
./nominatim-2.2.0/utils/setup.php--osm-file< own downloaded pbf data,shanghai.osm.pbf>--all [-- Osm2pgsql-cache]
Add additional fields:
./nominatim-2.2.0/utils/specialphrases.php–countries >specialphrases_countries.sql
psql-d nominatim-f Specialphrases_countries.sql
./nominatim-2.2.0/utils/specialphrases.php–wiki-import >specialphrases.sql
psql-d nominatim-f Specialphrases.sql
To establish a site:
sudo mkdir-m 755/var/www/nominatim
sudo chown <your username>/var/www/nominatim
./utils/setup.php--create-website/var/www/nominatim
To configure the Apache Environment:
Open /etc/apache2/sites-enabled/000-default, Add for example the following at the end:
<directory "/var/www/nominatim/" >
Options FollowSymLinks MultiViews
AddType text/html. php
</Directory>
To restart the Apache Service:
Service Apache2 Restart
add mypg permissions to the database Nominatim :
Su–postgres
Psql template1
GRANT all privileges on DATABASE Nominatim to MYPG
\q
4.ExecutionNominatim
Browser Login:http://http://localhost/nominatim/
See www-data user has no database read and write permissions, if not, then open /etc/apache2/envvars, change
Export APACHE_RUN_USER=MYPG
Export APACHE_RUN_GROUP=MYPG
Ubuntu 14.04 Installation field coding software Nominatim process