PostgreSQL 之 yum安裝 postgis 插件


版本說明:

CentOS7.5 + PostgreSQL 10.5

 

參考資源:

https://www.postgresql.org/download/linux/redhat/

http://download.osgeo.org/postgis/source/   postgis下載ftp網站

https://trac.osgeo.org/geos/                          geos官方網站

https://blog.csdn.net/xzwspy/article/details/80082082?utm_source=blogxgwz3     源碼安裝postgis,注意各個版本的兼容性

https://www.cnblogs.com/ilifeilong/p/6979288.html                                                    源碼安裝postgis,注意各個版本的兼容性

https://blog.csdn.net/learn_tech/article/details/80195566                                                 源碼安裝gdal

http://2057.iteye.com/blog/1616620                                                                                  

安裝postgresql

#Install the repository RPM
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm

#Install the client packages
yum install postgresql10

#Optionally install the server packages
yum install postgresql10-server

#Optionally initialize the database and enable automatic start
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10

Platform support

安裝PostGIS

1.先安裝幾個工具包

yum install wget net-tools epel-release -y

然后安裝postgis

yum install postgis24_10 postgis24_10-client -y

安裝拓展工具

yum install ogr_fdw10 -y
yum install pgrouting_10 -y

2.創建數據庫postgis

CREATE DATABASE postgis OWNER postgres;

切換新創建的database

\c postgis

安裝PostGis擴展

postgis=# CREATE EXTENSION postgis;
postgis=# CREATE EXTENSION postgis_topology;
postgis=# CREATE EXTENSION ogr_fdw;

然后可以驗證是否安裝成功

SELECT postgis_full_version();

 

另外,下面是官方網站點列的一份擴展:

-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- Enable PostGIS Advanced 3D
-- and other geoprocessing algorithms
-- sfcgal not available with all distributions
CREATE EXTENSION postgis_sfcgal;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- rule based standardizer
CREATE EXTENSION address_standardizer;
-- example rule data set
CREATE EXTENSION address_standardizer_data_us;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM