一、安装PostGIS扩展插件(24_10)

// 安装EPEL源
# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
// 安装PostGIS
# yum install -y postgis24_10

备注:提示依赖错误需要安装EPEL的源,对应的每个系统不一样,如下所示:

# CentOS , RHEL  -bit:
# rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# CentOS , RHEL -bit:(这里根据自已的系统版本作选择)
# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

提示:还有一些系统的,可以在上级目录找到(http://dl.fedoraproject.org/pub/epel/)。

二、开启PostgreSQL的PostGIS扩展并验证

// 开启插件
# su postgres
# psql
// 开启pgsql的插件
postgres=# create extension postgis;
postgres=# create extension postgis_topology;
postgres=# create extension fuzzystrmatch;
postgres=# create extension address_standardizer;
postgres=# create extension address_standardizer_data_us;
postgres=# create extension postgis_tiger_geocoder;
// 测试验证
-- 创建表
postgres=# create table mytable (
id serial primary key,
geom geometry(point, 26910),
name varchar(128)
);
-- 添加索引
postgres=# create index mytable_gix
on mytable
using gist (geom);
-- 添加一条数据
postgres=# insert into mytable (geom) values (
st_geomfromtext('point(0 0)', 26910)
);
-- 测试查询,正常能查出一条数据
postgres=# select id, name
from mytable
where st_dwithin(
geom,
st_geomfromtext('point(0 0)', 26910),
1000
);

参考:

http://postgis.net/install/(官网)

http://live.osgeo.org/zh/quickstart/postgis_quickstart.html

https://blog.csdn.net/ljg124034929/article/details/70142119

https://www.cnblogs.com/ilifeilong/p/6979288.html

https://blog.csdn.net/zeroneqin/article/details/51204202

http://www.xuebuyuan.com/2139871.html

https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm

CentOS 6.9/7通过yum安装指定版本的PostgreSQL扩展PostGIS的更多相关文章

  1. CentOS 6.9/7通过yum安装指定版本的PostgreSQL

    PostgreSQL(10+) 一.安装PostgreSQL // 安装EPEL源 # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel- ...

  2. CentOS 6.9/7通过yum安装指定版本的JDK/Maven

    说明:通过yum好处其实很多,环境变量不用配置,配置文件放在大家都熟悉的地方,通过rpm -ql xxx可以知道全部文件的地方等等. 一.安装JDK(Oracle JDK 1.8) # wget -- ...

  3. CentOS 6.9/7通过yum安装指定版本的Node.js

    说明:通过yum好处其实很多,环境变量不用配置,配置文件放在大家都熟悉的地方,通过rpm -ql xxx可以知道全部文件的地方等等. Node.js(8.x) 一.安装和配置 1.安装Node.js ...

  4. CentOS 6.9/7通过yum安装指定版本的MySQL

    一.安装CENTOS 6 # wget http://repo.mysql.com/mysql57-community-release-el6.rpm && rpm -ivh mysq ...

  5. CentOS 6.9/7通过yum安装指定版本的Redis

    一.安装 // 安装依赖 # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm && ...

  6. CentOS 6.9/7通过yum安装指定版本的Nginx

    说明:通过yum好处其实很多,环境变量不用配置,配置文件放在大家都熟悉的地方,通过rpm -ql nginx可以知道全部文件的地方等等. Nginx(1.12.2) 一.安装和配置 1.安装 # rp ...

  7. CentOS 6.9/7通过yum安装指定版本的Tomcat

    说明:通过yum好处其实很多,环境变量不用配置,配置文件放在大家都熟悉的地方,通过rpm -ql xxx可以知道全部文件的地方等等. 一.安装Tomcat(8+) // 下载脚本 # git clon ...

  8. 【Linuc-CentOS 】通过yum安装 指定版本的nodejs

    原 [Linuc-CentOS ]通过yum安装 指定版本的nodejs 2018年06月21日 06:56:32 黑夜的风 阅读数:884    版权声明:本文为博主原创文章,未经博主允许不得转载. ...

  9. 在CentOS系统中使用yum安装指定版本软件的方法

    yum默认都是安装最新版的软件,这样可能会出一些问题,或者我们希望yum安装指定(特定)版本(旧版本)软件包.所以,就顺带分享yum安装指定(特定)版本(旧版本)软件包的方法. 过程如下: 假设这里是 ...

随机推荐

  1. 获取AD用户名

    var wshNetwork = new ActiveXObject("WScript.Network"); alert("域名 = "+ wshNetwork ...

  2. centos上git搭建

    1 git的安装需要一些包: yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-Ex ...

  3. LeetCode818. Race Car

    https://leetcode.com/problems/race-car/description/ Your car starts at position 0 and speed +1 on an ...

  4. csu 1553(RMQ+尺取法)

    1553: Good subsequence Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: 794  Solved: 287[Submit][Statu ...

  5. SG函数(转自百度百科)

    给定一个有向无环图和一个起始顶点上的一枚棋子,两名选手交替的将这枚棋子沿有向边进行移动,无法移 动者判负.事实上,这个游戏可以认为是所有Impartial Combinatorial Games的抽象 ...

  6. jquery.query.js 插件(示例及简单应用) —— html之间传值

    帮助文档 var url = location.search; > "?action=view&section=info&id=123&debug&te ...

  7. CentOS7.6使用flatpak安装软件

    1.安装flatpak(CentOS 7已默认安装Flatpak) yum -y install flatpak 2.添加Flathub仓库 flatpak remote-add --if-not-e ...

  8. http学习笔记1

    通讯的条件 学前小故事 通过这个故事,我们来理解两台电脑之间的通信,必须具备什么样的条件? 有一天啊,这个小明和小强,一个在山的这头放牛,一个在山的那头割草.但是,由于无聊,这个小明就像找对面的小强聊 ...

  9. Numpy存取文件

    来自 Python科学计算 http://hyry.dip.jp/tech/book/page/scipy/numpy_file.html NumPy提供了多种存取数组内容的文件操作函数.保存数组数据 ...

  10. docker export import后,导入镜像,启动时的错误,Error response from daemon: No command specified

    Docker的流行与它对容器的易分享和易移植密不可分,用户不仅可以把容器提交到公共服务器上,还可以把容器导出到本地文件系统中.同样,我们也可以把导出的容器重新导入到Docker运行环境中.Docker ...