PostGIS安装

1.
tar -jxvf geos-3.6.0.tar.bz2
cd geos-3.6.0/
./configure --prefix=/opt/geos360
make
make install

2.
tar -zxvf proj-4.9.3.tar.gz
cd proj-4.9.3/
./configure --prefix=/opt/proj493
make
make install

3.
cd ~
vi .bash_profile
export LD_LIBRARY_PATH=/opt/pgsql101/lib
export PATH=/opt/pgsql101/bin:$PATH
export MANPATH=/opt/pgsql101/share/man:$MANPATH
source .bash_profile
tar -zxvf gdal-2.1.2.tar.gz
cd gdal-2.1.2/
./configure --prefix=/opt/gdal212
make
make install


4.
find / -name "xml2-config"
find / -name "geos-config"
find / -name "proj_api.h"

yum install -y libxml2-devel

cd ~
vi .bash_profile
export LD_LIBRARY_PATH=/opt/pgsql101/lib
export PATH=/opt/pgsql101/bin:$PATH
export MANPATH=/opt/pgsql101/share/man:$MANPATH
source .bash_profile

tar -zxvf postgis-2.4.3.tar.gz
cd postgis-2.4.3/
./configure --prefix=/opt/postgis243 --with-geosconfig=/opt/geos360/bin/geos-config --with-projdir=/opt/proj493/ --with-gdalconfig=/opt/geos360/bin/geos-config --with-gdalconfig=/opt/gdal212/bin/gdal-config
make
make install

 


su - root
cp /opt/geos360/lib/libgeos_c.so.1 /opt/pgsql101/lib
cp /opt/proj493/lib/libproj.so.12 /opt/pgsql101/lib
cp /opt/gdal212/lib/libgdal.so.20 /opt/pgsql101/lib

psql
CREATE EXTENSION fuzzystrmatch;
create extension postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION address_standardizer;

dx


ldd
用于打印程序或者库文件所依赖的共享库列表。

原文地址:https://www.cnblogs.com/dbalightyear/p/11211540.html