地理空间分析
PostGIS 扩展了 PostgreSQL 的功能,增加了对地理空间数据的存储、索引和查询支持。Cloudberry Database 支持 PostGIS 进行地理空间分析。
本文介绍了如何为你的 Cloudberry Database 集群编译和构建 PostGIS。
要查看 Cloudberry Database PostGIS 项目的仓库,请访问 cloudberrydb/postgis
。该仓库的 PostGIS 是专门为 Cloudberry Database 打造的,本文档介绍的编译构建方法,是基于该仓库的代码。
为 Cloudberry Database 编译 PostGIS
在为 Cloudberry Database 安装 PostGIS 之前,请先安装所需的依赖项并编译若干组件。目前,仅支持在 CentOS 系统上进行编译构建,未来计划支持 Rocky Linux。
在开始编译之前,请确保 Cloudberry Database 已正确安装。如果尚未安装,请参阅文档获取安装说明。
-
安装相关依赖。
yum install -y libtool proj-devel boost-devel gmp-devel mpfr-devel pcre-devel protobuf protobuf-c protobuf-devel protobuf-c-devel && \
yum install -y gcc make subversion gcc-c++ sqlite-devel libxml2-devel swig expat-devel libcurl-devel python36-devel json-c -
构建相关组件(GDAL、CGAL、SFCGAL 和 GEOS)。请确保你使用
root
用户进行构建。-
构建 GDAL。
GDAL 是一个用于栅格和矢量地理空间数据格式的转换库。按照以下命令进行安装:
wget https://download.osgeo.org/gdal/2.2.1/gdal-2.2.1.tar.gz --no-check-certificate
tar xf gdal-2.2.1.tar.gz
cd gdal-2.2.1/
./configure --prefix=/usr/local/gdal-2.2.1
make && make install
-