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 ...
随机推荐
- document.ready()的用法
1.Jquery是优秀的Javascrīpt框架,$是jquery库的申明,它很不稳定(我就常遇上),换一种稳定的写法jQuery.noConflict(); jQuery(document).rea ...
- Android源码下载
Android源码下载 1.安装git 2.安装repo 从这里 https://dl-ssl.google.com/dl/googlesource/git-repo/repo 下载repo文件 3. ...
- delphi 文件搜索,遍历所有子目录
function ListFiles(path: string): TStringList; var SearchRec: TSearchRec; found: integer; begin resu ...
- Linux下利用fork()创建子进程并使父进程等待子进程结束
int status; pid_t t = fork(); if(t){ waitpid(t, &status, 0); }else{ system("vi temp ...
- 将Dictionary序列化为json数据 、json数据反序列化为Dictionary
需要引用System.Web.Extensions dll类库 /// <summary> /// 将json数据反序列化为Dictionary /// </summary> ...
- UVA 674 Coin Change 换硬币 经典dp入门题
题意:有1,5,10,25,50五种硬币,给出一个数字,问又几种凑钱的方式能凑出这个数. 经典的dp题...可以递推也可以记忆化搜索... 我个人比较喜欢记忆化搜索,递推不是很熟练. 记忆化搜索:很白 ...
- SEO人员应该突破的5大思想误区
1.外链误区 很多人在做网站优化的时候容易陷入外链怪圈,认为外链就是网站优化的一切,只要做好外链排名就会上去,让他不做外链了他将不知道做什么.特别是外链专员和一些初级SEO人员,优化网站只知道到哪里发 ...
- Haffman编码(haffman树)
Haffman编码 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 哈弗曼编码大家一定很熟悉吧(不熟悉也没关系,自己查去...).现在给你一串字符以及它们所对应的权值 ...
- I NEED A OFFER!
I NEED A OFFER! Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Tot ...
- w3school教程整理
原文链接:http://www.flygon.net/w3school 原文链接:https://github.com/wizardforcel/w3school w3school教程整理 离线版大部 ...