Ubuntu 14.04安装地里编码软件Nominatim过程
一.必须软件:
在Ubuntu系统编译执行Nominatim软件系统必须安装的软件有:
1.GCC
编译器
2.postgresql
数据库
3.proj4
4.geos
5.postgis
6.PHP
7.PHP-pgsql
8.PEAR::DB
9.protobuf
10.wget
11.osmis
二.安装必须的软件包
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
因为导入的地理数据格式为pbf,所以须要安装pbf支持软件
apt-get install libprotobuf-c0-dev protobuf-c-compiler
在debian系统中,geos执行须要还有一个包
apt-get install libgeos++-dev
postgresql配置:
打开/etc/postgresql/9.3/main中的postgresql.conf文件,设置例如以下属性:
fsync = off
full_page_writes = off
详细命令为:
sudo vim /etc/postgresql/9.3/main中的postgresql.conf
三.安装Nominatim
1.下载源代码
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.在Nominatim文件夹中的settings文件夹里新建local.php文件,
配置例如以下:
<?php
// Paths
@define('CONST_Postgresql_Version', '9.3');
@define('CONST_Postgis_Version', '2.1');
@define('CONST_Website_BaseURL', 'http://localhost/nominatim/');
3.新建postgres用户账户:
1.新建导入账户
adduser <自己的username,example:mypg>
passwd <password>
su – postgres
psql -template1
界面切换到数据库的交互界面,敲入例如以下命令:
CREATE USER <自己的username,example:mypg>WITH PASSWORD <password>
退出数据库交互界面,敲入命令:\q
切换到root
新建站点用户:
createuser -SDR www-data
更改nominatim的读取权限:
chmod +x /soft_src
chmod +x /soft_src/Nominatim-2.2.0
chmod +x /soft_src/Nominatim-2.2.0/module
倒入下载的OSM数据,并为其建立索引:
下载数据地址为(pbf格式):
http://download.geofabrik.de/openstreetmap/
导入pbf数据:
./Nominatim-2.2.0/utils/setup.php --osm-file<自己下载的pbf数据,shanghai.osm.pbf>--all
[--osm2pgsql-cache ]
加入额外字段:
./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
建立站点:
sudo mkdir -m 755 /var/www/nominatim
sudo chown <your username> /var/www/nominatim
./utils/setup.php --create-website /var/www/nominatim
配置apache环境:
打开/etc/apache2/sites-enabled/000-default,在最后加入例如以下内容:
<Directory "/var/www/nominatim/">
Options FollowSymLinks MultiViews
AddType text/html .php
</Directory>
重新启动apache服务:
service apache2 restart
添加mypg对数据库nominatim的权限:
su – postgres
psql template1
GRANT ALL PRIVILEGES ON DATABASE nominatim to mypg
\q
4.执行nominatim
浏览器登陆:http://http://localhost/nominatim/
看www-data用户有没有数据库读写权限,若没有,则打开/etc/apache2/envvars,改动
export APACHE_RUN_USER=mypg
export APACHE_RUN_GROUP=mypg
Ubuntu 14.04安装地里编码软件Nominatim过程的更多相关文章
- 在Ubuntu 14.04安装和使用Docker
Docker是一个开源软件,它可以把一个Linux应用和它所依赖的一切(比如配置文件)都封装到一个容器.然而,Docker与虚拟机不同,它使用了沙箱机制,Docker容器不运行操作系统,它共享主机上的 ...
- [转]在Ubuntu 14.04安装和使用Docker
在Ubuntu 14.04安装和使用Docker 作者:chszs,版权所有,未经同意,不得转载.博主主页:http://blog.csdn.net/chszs Docker是一个开源软件,它可以把一 ...
- ubuntu 14.04 安装svn server (subversionedge )
ubuntu 14.04 安装subversionedge 请仔细阅读安装包自带的readme文件! 1.先去官网,找安装包: http://subversion.apache.org/ http:/ ...
- Ubuntu 14.04 安装adobe flash player
参考: How to install flash payer in Ubuntu 14.04 LTS? [duplicate] Ubuntu 14.04 安装adobe flash player 32 ...
- Ubuntu 14.04 安装VMware 12
/*********************************************************************** * Ubuntu 14.04 安装VMware 12 ...
- Ubuntu 14.04安装Chromium浏览器并添加Flash插件Pepper Flas
转自Ubuntu 14.04安装Chromium浏览器并添加Flash插件Pepper Flash Player Chromium谷歌的开源浏览器将不再支持Netscape浏览器插件API,Adobe ...
- ubuntu 14.04 安装搜狗拼音输入法
原文:ubuntu 14.04 安装搜狗拼音输入法 ubuntu桌面系统下终于有了好用的拼音法-搜狗拼音输入法,欲在ubuntu 14.04下安装搜狗拼音输入法相当的简单. 先到搜狗拼音官网下载对应的 ...
- ubuntu 14.04 安装torch及编译环境zbstudio
ubuntu 14.04 安装torch及编译环境zbstudio torch zbstudio 本来是安装官网给的步骤安装torch的,可是碰到一系列的问题,后来参考网上的安装方法安装成功了 官网安 ...
- Ubuntu 14.04 安装 sysrepo v0.7.5
参考: Tentative gNMI support with sysrepo protobuf-c/protobuf-c Ubuntu 14.04 安装 sysrepo v0.7.5 安装依赖: s ...
随机推荐
- delphi SysErrorMessage 函数和系统错误信息表 good
在看 API 文档时, 我们经常见到 GetLastError; 它可以返回操作后系统给的提示. 但 GetLastError 返回的只是一个信息代码, 如何返回对应的具体信息呢? FormatMes ...
- Azure 为 SAP 提供的增强监控解决方案
正如大家在之前公告中所看到的,多个SAP应用程序已获得认证可在 Azure虚拟机中运行,未来还会有更多 SAP应用程序获得认证.对于希望在 Azure中运行 SAP应用程序的客户来说,这是个激动人心的 ...
- #include <sstream>
1 std::istringstream 2 std::stringstream 1 std::istringstream input 1 在一个字符串string里提取部分数据,这些数据以空格' ' ...
- #include <stdlib.h>
1 _itoa 2 atoi 3 rand() 4 srand 1 _itoa _itoa(int value,char*string,int radix); int value 被转换的整数,cha ...
- Chocolate&&木块拼接&&Cards&& Wet Shark and Bishops
B. Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input o ...
- CentOS 修改默认语言
查看所有的locale语言 [root@centos6 ~]# locale -a ... ... ... ... xh_ZA xh_ZA.iso88591 xh_ZA.utf8 yi_US yi_U ...
- GCD 的初步认识
1.什么是 GCD? GCD为Grand Central Dispatch的缩写 (GCD)是Apple开发的一个多核编程的较新的解决方法.它主要用于优化应用程序以支持多核处理器以及其他对称多处理系统 ...
- 在node.js中使用ejs的demo 第五篇
先说明一下我的项目的目录解构: 本项目中渲染的时候都是通过在index.js页面里面,来使用index.ejs的,首先引用必须的模块: var express = require('express') ...
- C++_关键字
const static extern 限制-对象隐式类型转换
- ubuntu中Mysql常用命令整理
启动mysql服务sudo /etc/init.d/mysql start 关闭mysql服务sudo /etc/init.d/mysql stop