银河麒麟V10使用编译安装PostSQL+PostGIS

news2024/9/27 7:17:31

一、安装环境


银河麒麟V10

1、PostGIS简介


  PostGIS是对象关系型数据库系统PostgreSQL的一个扩展,PostGIS提供如下空间信息服务功能: 空间对象、空间索引、空间操作函数和空间操作符。同时,PostGIS遵循OpenGIS的规范。

二、使用make安装PostGIS

此时发现postgis在麒麟系统环境内并没有提供相关yum安装包,那么则进行所需运行环境程序的编译安装即可。


1、安装编译时环境


设置安装相应编译文件后也需要对相应的文件进行用户的授权,否则运行时会显示该用户无权限,或者文件不存在。运行 create extension *会出现错误

1.1、proj4安装

[root@localhost home]# wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz   # 下载文件

[root@localhost ~]# cd /home  # 如果已经下载好了,直接复制粘贴到该目录下
[root@localhost home]# tar -zxvf proj-4.9.3.tar.gz  # 解压
[root@localhost home]# cd proj-4.9.3

[root@localhost proj-4.9.3]# ./configure --prefix=/data-postgis/pgsql/plugin/proj

[root@localhost proj-4.9.3]# ./configure --prefix=/data-postgis/pgsql/plugin/proj 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking C_WFLAGS for maximum warnings... -Wall -Wdeclaration-after-statement
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for exp in -lm... yes
checking for ANSI C header files... (cached) yes
checking for localeconv... yes
checking jni.h usability... no
checking jni.h presence... no
checking for jni.h... no
checking whether to enable Java/JNI support... disabled
checking for mutexes... checking for pthread_create in -lpthread... yes
checking for pthread_mutexattr_settype in -lpthread... yes
checking whether PTHREAD_MUTEX_RECURSIVE is declared... yes
enabled, pthread
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cmake/Makefile
config.status: creating src/Makefile
config.status: creating man/Makefile
config.status: creating man/man1/Makefile
config.status: creating man/man3/Makefile
config.status: creating nad/Makefile
config.status: creating jniwrap/Makefile
config.status: creating jniwrap/org/Makefile
config.status: creating jniwrap/org/proj4/Makefile
config.status: creating nad/install
config.status: creating proj.pc
config.status: creating src/proj_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
[root@localhost proj-4.9.3]#

详情

[root@localhost proj-4.9.3]# make
 [root@localhost proj-4.9.3]# make install

 

 

[root@localhost proj-4.9.3]# echo "/data-postgis/pgsql/plugin/proj/lib" > /etc/ld.so.conf.d/proj-4.9.3.conf
[root@localhost proj-4.9.3]#  ldconfig

 1.2、geos

[root@localhost home]# wget http://download.osgeo.org/geos/geos-3.6.1.tar.bz2
[root@localhost home]# tar -jxf geos-3.6.1.tar.bz2
[root@localhost home]# cd geos-3.6.1 
[root@localhost geos-3.6.1]# ./configure --prefix=/data-postgis/pgsql/plugin/geos
[root@localhost geos-3.6.1]# make  预计5分钟

 

root@localhost geos-3.6.1]# make install
[root@localhost geos-3.6.1]# echo "/data-postgis/pgsql/plugin/geos/lib" > /etc/ld.so.conf.d/geos-3.6.1.conf
root@localhost geos-3.6.1]# ldconfig

 1.3、gdal

[root@localhost home]# wget http://download.osgeo.org/gdal/2.1.2/gdal-2.1.2.tar.gz
[root@localhost home]# tar -zxvf gdal-2.1.2.tar.gz
[root@localhost home]# cd gdal-2.1.2
[root@localhost gdal-2.1.2]# ./configure --prefix=/data-postgis/pgsql/plugin/gdal
[root@localhost gdal-2.1.2]# make && make install  # 预计时间30分钟

 [root@localhost gdal-2.1.2]# echo "/data-postgis/pgsql/plugin/gdal/lib" > /etc/ld.so.conf.d/gdal-2.1.2.conf 
[root@localhost gdal-2.1.2]# ldconfig
[root@localhost home]# cd /home

 2. 编译postgis安装包


2.1 编译安装

[root@localhost home]# wget http://postgis.net/stuff/postgis-2.5.3dev.tar.gz
[root@localhost home]# tar -zxvf postgis-2.5.3dev.tar.gz
[root@localhost home]# cd postgis-2.5.3dev
[root@localhost postgis-2.5.3dev]# ./configure --prefix=/data-postgis/pgsql/plugin/postgis --with-pgconfig=/data-postgis/pgsql/bin/pg_config --with-geosconfig=/data-postgis/pgsql/plugin/geos/bin/geos-config --with-gdalconfig=/data-postgis/pgsql/plugin/gdal/bin/gdal-config --with-projdir=/data-postgis/pgsql/plugin/proj
[root@localhost postgis-2.5.3dev]# make
[root@localhost postgis-2.5.3dev]# make install

 这里完成需要重新创建一个新的postgis_25数据库,详细参见postgresql部署3部分的-初始化数据库。否则启动/重启后一直提示找不到数据库。

2.2 安装扩展插件

# 切换postgres用户
su - postgres
# 登录PG数据库
psql
# 创建一个数据库
create database postgis;
# 切换到postgis库中
\c postgis
# 显示一下扩展模块
\dx

运行如下sql内容

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
--CREATE EXTENSION fuzzystrmatch;
--CREATE EXTENSION postgis_tiger_geocoder

 做到这里就完成的插件的安装。

3、创建数据库spatial_testdb

CREATE DATABASE spatial_testdb OWNER postgres;

进入 \c spatial_testdb 

4、安装PostGis扩展

spatial_testdb=# CREATE EXTENSION postgis;
spatial_testdb=# CREATE EXTENSION postgis_topology;
spatial_testdb=# CREATE EXTENSION ogr_fdw;

然后可以验证是否安装成功

SELECT postgis_full_version();

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/738352.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Day49

思维导图 练习 闹钟设计 widget.h #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QDebug> #include <QPushButton> #include <QLabel> #include <QLineEdit> #include <QTextEdit> #include <QTimer> …

【C++】STL——stack和queue使用及模拟实现

&#x1f680; 作者简介&#xff1a;一名在后端领域学习&#xff0c;并渴望能够学有所成的追梦人。 &#x1f681; 个人主页&#xff1a;不 良 &#x1f525; 系列专栏&#xff1a;&#x1f6f8;C &#x1f6f9;Linux &#x1f4d5; 学习格言&#xff1a;博观而约取&#xff0…

ICG试剂大合集:ICG-COOH/NHS/NH2/Maleimide/alkyne/N3

荧光染料及其荧光标记技术一直是生物领域常用的产品和技术&#xff0c;标记荧光的波长从300nm到1000nm&#xff0c;除了常见的FITC、FAM等荧光标记染料外&#xff0c;还包括Cy3&#xff0c;Cy3.5&#xff0c;Cy5, Cy5.5&#xff0c;Cy7&#xff0c;Cy7.5&#xff0c;ICG各种衍生…

vue2登录存储案例:sessionStorage会话存储+localStorage本地存储

vue2可以通过sessionStorage来实现登录以后的数据存储&#xff0c;是H5提供的一个API&#xff0c;可以在浏览器会话期间保持数据 简单模拟一个登录后的存储功能 目录 一、sessionStorage存储 二、localStorage本地存储 一、sessionStorage存储 1、登录的HTML方法 HTML &l…

Java基础---注解

目录 典型回答 什么是元注解 如何判断注解 典型回答 Java 注解用于为 Java 代码提供元数据作为元数据&#xff0c;注解不直接影响你的代码执行&#xff0c;但也有一些类型的注解实际上可以用于这一目的Java注解是从 Java5 开始添加到 Java 的Java的注解&#xff0c;可以说是…

GitHub Pages + Hexo

步骤 参考如下步骤&#xff1a;https://blog.csdn.net/yaorongke/article/details/119089190 出现的问题 1 Fluid主题 其更换Fluid主题时&#xff1a; 下载最新 release 版本 解压到 themes 目录&#xff0c;并将解压出的文件夹重命名为 fluid 按照上面执行后&#xff0c;后…

Michael.W基于Foundry精读Openzeppelin第7期——Timers.sol

Michael.W基于Foundry精读Openzeppelin第7期——Timers.sol 0. 版本0.1 Timers.sol 1. 目标合约2. 代码精读2.1 区块链时间戳维度2.1.1 Timestamp结构体2.1.2 setDeadline(Timestamp storage, uint64) && getDeadline(Timestamp memory)2.1.3 reset(Timestamp storage)…

Linux:基于PXE的kickstart无人值守技术

*创建应答文件&#xff0c;预先定义好各种安装设置 *免去交互设置过程&#xff0c;从而实现全自动化安装 *通过添加%post脚本&#xff0c;完成安装后的各种配置操作 需要的环境为 pxe&#xff08;dhcp&#xff0c;tftp&#xff0c;yum&#xff09; Linux&#xff1a;PXE网络装…

深度学习——批数据训练

代码与详细注释&#xff1a; BATCH_SIZE 5&#xff0c;shuffleTrue import torch import torch.utils.data as Data# 添加随机种子以使结果可复现 torch.manual_seed(1) # reproducible# 批大小 BATCH_SIZE 5 # BATCH_SIZE 8x torch.linspace(1, 10, 10) # this…

VScode 终端无法识别npm以及Missing script: “serve“ 问题

无法识别npm解决办法&#xff1a; 原因是没有全局安装npm 1.通过终端查看已经全局安装的模块 npm list --depth0 -global 2.全局安装npm npm install -g npm Missing script: "serve" 问题&#xff1a; 原因是package.json中没有配置&#xff1a;"serve"…

JUC 并发编程

文章目录 JUC 并发编程一、Lock 锁1. 可重入锁2. 公平锁3. 读写锁3.1 ReadWriteLock 接口3.2 ReentrantReadWriteLock 类3.3 锁降级 4. 线程间通信4.1 虚假唤醒4.2 线程通信&#xff08;Condition&#xff09;4.3 定制化线程通信 二、集合线程安全1. CopyOrWrite2. ConcurrentH…

机试刷题记录 2023-7-6

AB问题 题目描述 Time Limit: 1000 ms Memory Limit: 256 mb 输入A,B 输出AB -1,000,000,000<A,B<1,000,000,000 输入输出格式 输入描述: 输入包含两个整数A,B&#xff0c;用一个空格分隔。 输出描述: 输出一个整数&#xff0c;表示AB的值。 输入输出样例 输入…

ResNet网络结构入门

ResNet网络结构入门 一、传统卷积神经存在的问题二、Residual 结构&#xff08;残差结构&#xff09;ResNet 中的残差结构ResNet 中的 short cut 三、Batch Normalization Resnet 网络创新点 提出 Residual 结构&#xff08;残差结构&#xff09;&#xff0c;可搭建超深的网络…

第44节:cesium 大雾效果(cesium自带)(含源码+视频)

结果示例: 完整源码: <template><div class="viewer"><vc-viewer @ready="ready" :logo="false"><!

C#核心知识回顾——12.lambda表达式、List排序、协变和逆变

1.Lambda表达式 可以将lambad表达式理解为匿名函数的简写 它除了写法不同外&#xff0c;使用上和匿名函数一模一样 都是和委托或者事件配合使用的 //匿名函数 //delegate&#xff08;参数列表&#xff09; //{ //} //lambda表达式 //(参数列表) > //{ //函数体 //…

【Axure高保真原型】冻结固定中继器表格首尾两列

今天和大家分享冻结固定中继器表格首尾两列的原型模板&#xff0c;当我们遇到表格内容较多时&#xff0c;可以用这个模板固定第一列和最后一列操作列。这个模板是用中继器制作的&#xff0c;所以使用也很简单&#xff0c;只需要在中继器里填写对应数据即可&#xff0c;具体效果…

游戏渲染技术:前向渲染 vs 延迟渲染 vs Forward+渲染(二)

GTA5 2 前向渲染 前向渲染是三个光照技术中最简单的&#xff0c;也是游戏图形渲染中最常见的技术。出于这个原因&#xff0c;也是光照计算最昂贵的技术&#xff0c;它不允许在场景中出现大量的动态光源。 大部分使用前向渲染的图形引擎会采用一些技术来模拟场景中大量的光源的…

K8S应用流程安全(镜像安全 配置管理 访问安全)

应用流程安全 1 应用流程安全1.1 镜像安全1.1.1 构建原则1.1.2 Dockerfile实践1.1.3 构建进阶1.1.4 镜像检测1.1.5 仓库升级1.1.6 高可用仓库1.1.7 镜像策略 1.2 配置管理1.2.1 配置基础1.2.2 YAML安全1.2.3 kustomize1.2.4 基础实践1.2.5 功能复用1.2.6 配置定制1.2.7 补丁实践…

python接口自动化(二十七)--html 测试报告——上(详解)

简介 上一篇我们批量执行完用例后&#xff0c;生成的测试报告是文本形式的&#xff0c;不够直观&#xff0c;而且报告一般都是发给leader的&#xff0c;所以最好是直观一目了然&#xff0c;为了更好的展示测试报告&#xff0c;最好是生成 HTML 格式的。unittest 里面是不能生成…

SpringBoot——加载测试专用的配置类

加载测试专用的配置类 之前我们介绍了如何在测试类中加载专用的测试属性&#xff0c;这次我们来看如何在测试类中加载专用的测试类。 创建配置类 首先创建一个配置类&#xff0c;并且创建一个第三方的Bean模拟这是一个要在测试用例中引用的第三方Bean 创建测试用例 创建一个…