当前位置: 首页 > 工具软件 > PostGIS > 使用案例 >

postgis编译

邹普松
2023-12-01

Postgis

编译postgis需要安装Proj4、GEOS、GDAL、SFCGAL

环境

gcc:11.1.0

版本

  • postgis:2.5.2

    wget http://download.osgeo.org/postgis/source/postgis-2.5.2.tar.gz
    
  • postgresql:10.21

  • GEOS:3.6.1

    wget http://download.osgeo.org/geos/geos-3.6.1.tar.bz2
    
    
  • Proj4:4.9.3

    wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz
    
  • GDAL:2.1.2

    wget http://download.osgeo.org/gdal/2.1.2/gdal-2.1.2.tar.gz
    
    
  • SFCGAL:1.3.1

编译

Proj4

./configure --prefix=/usr/proj
make
make install

GEOS

 ./configure --prefix=/usr/geos
 make
 make install

GDAL

./configure --prefix=/usr/gdal
make
make install

SFCGAL

安装SFCGAL需要CGAL支持,这次使用rpm安装CGAL和SFCGAL

https://pkgs.org/search/https://pkgs.org/search/?q=cgal 下载
CGAL-4.7-1.rhel7.1.aarch64.rpm
CGAL-devel-4.7-1.rhel7.1.aarch64.rpm
SFCGAL-1.3.1-4.rhel7.aarch64.rpm
SFCGAL-devel-1.3.1-4.rhel7.aarch64.rpm
SFCGAL-libs-1.3.1-4.rhel7.aarch64.rpm

Postgis

安装libxml2、zlib、perl

./configure --with-pgconfig=/usr/bin/pg_config --with-geosconfig=/usr/geos/bin/geos-config --with-gdalconfig=/usr/gdal/bin/gdal-config  --with-projdir=/usr/proj --with-sfcgal=/usr/bin/sfcgal-config  --prefix=/usr/postgis/
make
make install
 类似资料: