linuxcentos下安装postgresql数据库以及yum下载安装postgis扩展
linux centos下安装postgresql数据库以及yum下载安装postgis扩展
Centos7操作系统下的postgresql下载
https://www.postgresql.org/download/linux/redhat/sudoyuminstall-yhttps://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpmsudoyuminstall-ypostgresql13-serversudo/usr/pgsql-13/bin/postgresql-13-setupinitdbsudosystemctlenablepostgresql-13sudosystemctlstartpostgresql-13
查看当前系统哪些进程正在监听TCP端口5432
netstat-tnlp|grep5432
下载安装postgis扩展
首先我们在yum源里面查看可用的postgisab
yumlist|greppostgis*
红色的部分是 postgis 的版本 (在写这篇博客的时候postgis的最高版本为3.3),蓝色的框 是postgresql的版本号,大家选择自己对应的版本安装
例如我需要安装 postgresql 版本为13的,postgis版本为 3.3的postgis扩展,
然后我们执行
yuminstallpostgis33_14.x86_64
就可以完成postgis的安装!
安装postgis扩展
进入postgresql执行下面语句,安装所有的postgis的驱动
setpostgis.gdal_enabled_drivers='ENABLE_ALL';CREATEEXTENSIONpostgis;--EnableTopologyCREATEEXTENSIONpostgis_topology;--EnablePostGISAdvanced3D--andothergeoprocessingalgorithms--sfcgalnotavailablewithalldistributionsCREATEEXTENSIONpostgis_sfcgal;--fuzzymatchingneededforTigerCREATEEXTENSIONfuzzystrmatch;--rulebasedstandardizerCREATEEXTENSIONaddress_standardizer;--exampleruledatasetCREATEEXTENSIONaddress_standardizer_data_us;--EnableUSTigerGeocoderCREATEEXTENSIONpostgis_tiger_geocoder;CREATEEXTENSIONpostgis_raster;
有些文章会漏了这两个,加上就好了。
setpostgis.gdal_enabled_drivers='ENABLE_ALL';CREATEEXTENSIONpostgis;
原文链接:https://www.kuazhi.com/post/584011.html
本网站文章未经允许禁止转载,合作/权益/投稿 请联系平台管理员 Email:epebiz@outlook.com