Centos7操作系统下的postgresql下载
https://www.postgresql.org/download/linux/redhat/ sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm sudo yum install -y postgresql13-server sudo /usr/pgsql-13/bin/postgresql-13-setup initdb sudo systemctl enable postgresql-13 sudo systemctl start postgresql-13
查看当前系统哪些进程正在监听TCP端口5432
netstat -tnlp | grep 5432
下载安装postgis扩展
首先我们在yum源里面查看可用的postgisab
yum list | grep postgis*
红色的部分是 postgis 的版本 (在写这篇博客的时候postgis的最高版本为3.3),蓝色的框 是postgresql的版本号,大家选择自己对应的版本安装
例如我需要安装 postgresql 版本为13的,postgis版本为 3.3的postgis扩展,
然后我们执行
yum install postgis33_14.x86_64
就可以完成postgis的安装!
安装postgis扩展
进入postgresql执行下面语句,安装所有的postgis的驱动
set postgis.gdal_enabled_drivers ='ENABLE_ALL'; 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; CREATE EXTENSION postgis_raster;
有些文章会漏了这两个,加上就好了。
set postgis.gdal_enabled_drivers ='ENABLE_ALL'; CREATE EXTENSION postgis;
原文链接:https://www.kuazhi.com/post/584011.html
发表评论
2024-01-05 14:16:48回复
2024-01-05 14:15:32回复
https://www.51969.com/post/15782891.html
这个是windows的安装,不是centos的
2024-01-05 14:14:50回复
https://www.51969.com/post/15786730.html
这个有点老。
2024-01-05 14:11:19回复
https://www.51969.com/post/17824373.html
搜索到这个手动安装postgis扩展很好用,谢谢**。
2024-01-05 14:05:28回复
2024-01-05 14:07:38回复