PgRouting CentOs6 安装以及使用
来源:互联网 发布:淘宝怎样延长收货时间 编辑:程序博客网 时间:2024/06/11 16:19
安装
添加yum源
wget http://repo.enetres.net/enetres.repo -O /etc/yum.repos.d/enetres.repowget http://nextgis.ru/programs/centos/nextgis.repo -O /etc/yum.repos.d/nextgis.repoyum install epel-release
安装PostgreSQL and PostGIS
注意:由于yum源中目前只有pgrouting94版本,所以 PostgreSQL 和 PostGIS也应该安装94版本,避免在安装pgrouting的时候产生依赖问题
配置yum
vi /etc/yum.repos.d/CentOS-Base.repo# 在[end] section 后添加exclude=postgresql*# 在[updates] section 后添加exclude=postgresql*
下载安装Postgres rpm 包
官网地址http://yum.postgresql.org/repopackages.php
下载后安装
rpm -ivh pgdg-centos94-9.4-1.noarch.rpm
安装PostGis
PostGis 依赖proj 4.8 ,安装前首先更新proj
yum update proj
然后安装
yum install postgresql94-server postgis2_94
如果出现重复安装问题,使用如下命令
yum install yum-utilspackage-cleanup --cleandupes
安装完成后使用以下命令启动服务
service postgresql-9.4 initdbservice postgresql-9.4 startchkconfig postgresql-9.4 on
安装CGAL
yum install libCGAL10
安装pgRouting
yum install pgrouting_94
登录
默认配置下登录
# 切换到postgres账户su - postgres# 登录到postgres 数据库psql
创建新用户访问
su - postgrespsql# 创建用户以及密码create user dbuser with password '*****';# 创建数据库create database exampledb owner dbuser;# 将exampledb 的权限赋给 dbusergrant all privileges on database exampledb to dbuser;# 使用 \q 退出# 创建和刚才同名的linux用户sudo adduser dbusersudo passwd dbuser# 切换到dbuser身份 连接数据库psql -d exampledb
创建和当前用户同名的用户名以及数据库
su - postgrespsqlcreate user root with password '*****';create database root owner root;grant all privileges on database root to root\qexit# 切回到 root 账户后使用psql 命令可以直接连接到数据库# 如果找不到psql 命令,需要将postgres 路径添加到系统环境变量echo -e "export PATH=/usr/pgsql-9.4/bin:\$PATH" >> ~/.bash_profilesource ~/.bash_profile
使用pgrouting
创建database
登录后创建database
createdb mydatabase# 创建扩展create extension postgiscreate extension pgrouting
导入osm数据
导入osm数据目前可以使用以下工具
1. osm2pgrouting(导入后不需要再额外创建拓扑,还没尝试)
2. osm2pgsql (导入数据后需要创建拓扑)
编译安装osm2pgsql
- 下载git clone git://github.com/openstreetmap/osm2pgsql.git
- 安装依赖
sudo yum install epel-releasesudo yum install cmake gcc-c++ boost-devel expat-devel zlib-devel bzip2-devel \ postgresql-devel proj-devel proj-epsg lua-devel
安装依赖过程中可能会找不到boost,需要编译安装boost
#下载boost./bootstrap.sh./b2./b2 install在 /etc/ld.so.conf 添加/usr/local/libldconfig
- 安装
mkdir -p bulid && cd buildcmake ..makemake install
- Usage
createdb gispsql -d gis -c 'create extension postgis;create extension hstore'osm2pgsql --create --database gis data.osm.pbf
阅读全文
0 0
- PgRouting CentOs6 安装以及使用
- Centos6使用yum安装PostGres以及PostGis
- centos安装pgrouting
- pgrouting
- Linux(centos6.0)下安装Node.js以及使用
- Linux(centos6.0)下安装Node.js以及使用
- Linux(centos6.0)下安装Node.js以及使用
- 使用pgRouting进行路径分析
- linux(CentOS6)上mysql的安装、远程登录和使用以及mysql-python的实验
- Centos6 安装 mysql 以及 配置 导入 备份
- CentOS6.5 安装Zend Studio 以及 破解
- centos6.3 安装vnc以及注意事项
- centos6.3下安装phpredisadmin,以及配置文件
- CentOS6.5 yum安装svn以及配置
- centos6.4安装使用wine
- Centos6 使用yum安装mysql
- Centos6.5安装使用NFS
- 使用VMware安装CentOS6.7
- 物流链云平台成品仓-wms简介
- LeetCode 算法第四题
- JavaFx在Mac OS中实现系统样式的菜单
- jQuery 语法
- Linux目录结构和常用命令
- PgRouting CentOs6 安装以及使用
- Linux下区分物理CPU、逻辑CPU和CPU核数
- *args和**kwargs
- webpack项目流程学习(二)
- 漏洞利用查询工具sandi
- WIN10 + VS2015 + WDK10 + SDK10 + VM虚拟机驱动开发调试环境搭建
- CTX学长的快速幂(快速幂运用)
- 注解式读取properties文件中的内容
- mysql和oracle函数比较