管网 http://postgis.net/install/
0、安装一些相关的依赖
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
0、查看postgresql
psql --version
1、在更换数据源上查看有哪些postgis版本
yum search postgis
2、安装与postgresql对应的postgis版本
对应关系 https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS
yum -y install postgis30_13
该包名字含义为postgresql版本为11+postgis版本为3.0
postgis3.0以上的版本数据库开启扩展
-- Enable PostGIS (as of 3.0 contains just geometry/geography)
-- 启用PostGIS
CREATE EXTENSION postgis;
-- enable raster support (for 3+)
-- 启用栅格支持
CREATE EXTENSION postgis_raster;
-- 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;
本人测试了postgresql9-13共5个大版本,结合postgis后,使用qgis连接和使用geoserver均没有问题。