hgdb安装postgis
目录
安装PostGIS之前必须先安装proj,geos,gdal.
安装依赖包
[root@hgdb ~]# yum install -y python-devel perl-ExtUtils-Embed python-devel gcc-c++ openssl-devel readline readline-devel zlib zlib-devel openssl openssl-devel pam pam-devel libxml2 libxml2-devel libxslt libxslt-devel openldap openldap-devel libgeos-dev libproj-dev libgdal-dev xsltproc docbook-xsl docbook-xml imagemagick libmagickcore-dev dblatex tcl tcl-devel unixODBC unixODBC-devel libpng12 libpng12-devel
安装proj
[highgo@hgdb ~]$ cd proj-4.9.3/
[highgo@hgdb proj-4.9.3]$ ./configure --prefix=/data/highgo/4.3.2/plugin/proj
[highgo@hgdb proj-4.9.3]$ make
[highgo@hgdb proj-4.9.3]$ make install
配置和加载动态链接库
[root@hgdb ~]# echo "/data/highgo/4.3.2/plugin/proj/lib/" > /etc/ld.so.conf.d/proj-4.9.3.conf
[root@hgdb ~]# ldconfig
安装geos
[highgo@hgdb ~]$ cd geos-3.6.2/
[highgo@hgdb geos-3.6.2]$ ./configure --prefix=/data/highgo/4.3.2/plugin/geos
[highgo@hgdb geos-3.6.2]$ make
[highgo@hgdb geos-3.6.2]$ make install
配置和加载动态链接库
[root@hgdb ~]# echo "/data/highgo/4.3.2/plugin/geos/lib" >/etc/ld.so.conf.d/geos-3.6.2.conf
[root@hgdb ~]# ldconfig
安装gdal
[highgo@hgdb ~]$ unzip gdal224.zip
[highgo@hgdb gdal-2.2.4]$ ./configure --prefix=/data/highgo/4.3.2/plugin/gdal
[highgo@hgdb gdal-2.2.4]$ make
[highgo@hgdb gdal-2.2.4]$ make install
配置和加载动态链接库
[root@hgdb ~]# echo "/data/highgo/4.3.2/plugin/gdal/lib" > /etc/ld.so.conf.d/gdal-2.2.4.conf
[root@hgdb ~]# ldconfig
安装postgis
[highgo@hgdb ~]$ tar -zxf postgis-2.2.7.tar.gz
[highgo@hgdb ~]$ cd postgis-2.2.7/
[highgo@hgdb postgis-2.2.7]$ ./configure --prefix=/data/highgo/4.3.2/plugin/postgis --with-pgconfig=/data/highgo/4.3.2/bin/pg_config --with-geosconfig=/data/highgo/4.3.2/plugin/geos/bin/geos-config --with-gdalconfig=/data/highgo/4.3.2/plugin/gdal/bin/gdal-config --with-projdir=/data/highgo/4.3.2/plugin/proj
[highgo@hgdb postgis-2.2.7]$ make
[highgo@hgdb postgis-2.2.7]$ make install
启动hgdb,导入PostGIS插件
[highgo@hgdb ~]\$ pg_ctl start -D /data/highgo/4.3.2/data -l /data/highgo/4.3.2/logfile
server starting
[highgo@hgdb ~]\$ psql
psql (4.3.2)
PSQL: Release 4.3.2
Connected to:
HighGo Database V4.3 Enterprise Edition Release 4.3.2 - 64-bit Production
Type "help" for help.
highgo=\# SELECT postgis_full_version();
postgis_full_version
-----------------------------------------------------------------------------------------------------------------
-------------------------------------------------
POSTGIS="2.2.7 r16522" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.4, rel
eased 2018/03/19" LIBXML="2.9.1" TOPOLOGY RASTER
(1 row)
highgo=# create extension postgis;
CREATE EXTENSION
highgo=# CREATE EXTENSION postgis_topology;
CREATE EXTENSION
highgo=# CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION
highgo=# CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION
highgo=# \dx
List of installed extensions
Name | Version | Schema | Description
------------------------+---------+------------+-----------------------------------------------------------------
----
fuzzystrmatch | 1.0 | public | determine similarities and distance between strings
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
postgis | 2.2.7 | public | PostGIS geometry, geography, and raster spatial types and functi
ons
postgis_tiger_geocoder | 2.2.7 | tiger | PostGIS tiger geocoder and reverse geocoder
postgis_topology | 2.2.7 | topology | PostGIS topology spatial types and functions
(5 rows)
by z
转载自:https://blog.csdn.net/pg_hgdb/article/details/80174372