postgres安装02--postgis
未完成目標:
http://www.cnblogs.com/bulvlanshan/p/9002919.html
1.遠程登錄
2.安裝postgis-2.2.6
關于遠程訪問,只需要改兩點,我們不在過多解釋
1.postgresql.conf
listen_addresses項值設定為“*”
2.pg_hba.conf
host all all 127.0.0.1/32 md5
host??? all??? all??? 0.0.0.0/0??? md5
重點postgis安裝
我們選擇的版本postgis-2.2.6
1.安裝包
yum list|grep libxml2
yum -y install json-c json-c-devel
wget http://download.osgeo.org/geos/geos-3.5.1.tar.bz2
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz
wget http://download.osgeo.org/gdal/2.2.0/gdal-2.2.0.tar.gz
wget https://download.osgeo.org/postgis/source/postgis-2.2.6.tar.gz
2.安裝組件
cd ../geos-3.5.1/
./configure --prefix=/home/postgres/geos
make? && make install
cd ../proj-4.9.3/
./configure --prefix=/home/postgres/proj4
make? && make install
cd ../gdal-2.2.0
./configure --prefix=/home/postgres/gdal --with-pg=/data/pgsql/bin/pg_config
make? && make install
3.加載
[root@postgres-test01-0001 ~]# vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/home/postgres/lib
/home/postgres/geos/lib
/home/postgres/proj4/lib
/home/postgres/gdal/lib
/data/pgsql/lib/
[root@postgres-test01-0001 ~]# ldconfig
4.最后一步安裝postgis
cd ../postgis-2.2.6/
./configure --prefix=/home/postgres --with-gdalconfig=/home/postgres/gdal/bin/gdal-config --with-pgconfig=/data/pgsql/bin/pg_config --with-geosconfig=/home/postgres/geos/bin/geos-config --with-projdir=/home/postgres/proj4?--with-gdalconfig
make && make install
5.出錯情況
postgis中執行./configure時,遇到 checking for library containing GDALAllRegister... no?
將postgres庫也要加入/etc/ld.so.conf
/data/pgsql/lib/
記得要:ldconfig
測試:
[root@postgres-test01-0001 postgis-2.2.6]# ldconfig -p | grep libpg
libpgtypes.so.3 (libc6,x86-64) => /data/pgsql/lib/libpgtypes.so.3
libpgtypes.so (libc6,x86-64) => /data/pgsql/lib/libpgtypes.so
6.測試
命令:
[postgres@postgres-test01-0001 ~]$ psql
psql (9.4.16)
Type "help" for help.
postgres=# create database gistest;
CREATE DATABASE
postgres=# \c gistest
You are now connected to database "gistest" as user "postgres".
gistest=# CREATE EXTENSION postgis;
CREATE EXTENSION
gistest=# CREATE EXTENSION postgis_topology;
CREATE EXTENSION
gistest=# SELECT postgis_full_version();
postgis_full_version
-------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------
POSTGIS="2.2.6 r16006" GEOS="3.5.1-CAPI-1.9.1 r4246" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.0, released 2017/04/28" LIBXML
="2.9.1" LIBJSON="0.11" TOPOLOGY RASTER
(1 row)
gistest=#
?
轉載于:https://www.cnblogs.com/bulvlanshan/p/9002966.html
總結
以上是生活随笔為你收集整理的postgres安装02--postgis的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ABAP使用文件
- 下一篇: redis的7个应用场景