当前位置: 首页 > news >正文

网站建设 中企动力 顺德浙江中天建设集团有限公司网站

网站建设 中企动力 顺德,浙江中天建设集团有限公司网站,wordpress资讯源码,做网站很挣多少钱前一段时间记录了下如何在centos7中离线安装postgresql,因为工作需要,我不仅要安装postgresql,还需要安装postgis插件,这篇文章记录下postgis插件的安装过程。 1. 安装前的参考 如下的链接都是官网上的链接,对你安装p…

        前一段时间记录了下如何在centos7中离线安装postgresql,因为工作需要,我不仅要安装postgresql,还需要安装postgis插件,这篇文章记录下postgis插件的安装过程。

1. 安装前的参考

        如下的链接都是官网上的链接,对你安装postgis 应该会有很大的帮助,安装前可以先仔细看看;

  1. https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS 最新版依赖及下载地址
    在这里插入图片描述
  2. https://trac.osgeo.org/postgis/wiki/PostGISObsoleteVersionsMatrix 版本依赖说明
    在这里插入图片描述
  3. https://trac.osgeo.org/postgis/wiki/UsersWikiInstall 安装指引
    在这里插入图片描述
  4. https://trac.osgeo.org/postgis/wiki
    在这里插入图片描述

2. 我安装的版本

        由于工作需要,我安装的版本与我们线上保持一致,pg安装的是11.11,postgis安装的是2.5,其它详细信息如下:

软件依赖版本
postgresql11.11
postgis2.5
 godal2.2.3
 proj4.8.0
 geos3.5.1
 json-c0.10
 protobuf2.6.1
 protobuf-c1.2.1
 LibXML22.7.7

3.安装依赖

        安装postgis共分成两步,第一步是安装依赖,第二步是安装postgis本身,因为postgis需要的依赖比较多,一个一个安装需要有点儿耐心。
        注意,如下目录需要修改成你自己使用的目录

3.1 安装gdal

tar -zxvf gdal-2.2.3.tar.gz
cd gdal-2.2.3
./configure --prefix=/app/address/postgre/postgis_dep/gdal
make 
make install

3.2 安装proj

tar -zxvf proj-4.8.0.tar.gz
cd proj-4.8.0
./configure --prefix=/app/address/postgre/postgis_dep/proj
make
make install

3.3 安装geos

tar -jxvf geos-3.5.1.tar.bz2
cd geos-3.5.1
./configure --prefix=/app/address/postgre/postgis_dep/geos
make 
make install

3.4 安装 json-c

tar -zxvf json-c-0.10.tar.gz
cd json-c-0.10
./configure --prefix=/app/address/postgre/postgis_dep/json-c
make
make install

3.5 安装protobuf

tar -zxvf protobuf-2.6.1.tar.gz
cd protobuf-2.6.1
./configure --prefix=/app/address/postgre/postgis_dep/protobuf
make
make install

3.6 安装 protobuf-c

tar -zxvf protobuf-c-1.2.1.tar.gz
cd protobuf-c-1.2.1
./configure --prefix=/app/address/postgre/postgis_dep/protobuf-c
make
make install

3.7 安装LibXML2

下载地址 http://xmlsoft.org/sources/
tar -zxvf libxml2-2.7.7.tar.gz
cd libxml2-2.7.7
./configure --prefix=/app/address/postgre/postgis_dep/libxml2
make
make install

3.8 编辑 ld.so.conf

增加如下配置

/app/address/postgre/postgis_dep/geos/lib
/app/address/postgre/postgis_dep/gdal/lib
/app/address/postgre/postgis_dep/proj/lib
/app/address/postgre/postgis_dep/json-c/lib
/app/address/postgre/postgis_dep/protobuf/lib
/app/address/postgre/postgis_dep/protobuf-c/lib
/app/address/postgre/postgis_dep/libxml2/lib执行sudo ldconfig 使生效

3.9 修改环境配置文件

修改 vi ~/.bashrc
增加如下配置

export PKG_CONFIG_PATH=/app/address/postgre/postgis_dep/protobuf/lib/pkgconfigexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/address/postgre/postgis_dep/geos/lib:/app/address/postgre/postgis_dep/gdal/lib:/app/address/postgre/postgis_dep/proj/lib:/app/address/postgre/postgis_dep/json-c/lib:/app/address/postgre/postgis_dep/protobuf/lib:/app/address/postgre/postgis_dep/protobuf-c/lib:/app/address/postgre/postgis_dep/libxml2/lib

source ~/.bashrc 使生效

4. 安装postgis

4.1 安装postgis

tar -zxvf postgis-2.5.0.tar.gz
cd postgis-2.5.0
./configure --with-geosconfig=/app/address/postgre/postgis_dep/geos/bin/geos-config --with-projdir=/app/address/postgre/postgis_dep/proj --with-gdalconfig=/app/address/postgre/postgis_dep/gdal/bin/gdal-config --with-jsondir=/app/address/postgre/postgis_dep/json-c --with-pgconfig=/app/address/postgre/pginstall/bin//pg_config --with-xml2config=/app/address/postgre/postgis_dep/libxml2/bin/xml2-config
make
make install

在这里插入图片描述

4.2 登录数据库,创建扩展

psql postgres
创建扩展
create extension postgis;
create extension postgis_topology;

在这里插入图片描述

4.3 测试

select postgis_full_version();
在这里插入图片描述
SELECT ST_SetSRID(ST_Point(-87.71,43.741),4326),ST_GeomFromText(‘POINT(-87.71 43.741)’,4326);
在这里插入图片描述

5. 错误解决

  1. fatal error: json_object_iterator.h: No such file or director
    在这里插入图片描述
    解决:yum install json-c-devel

  2. error: #pragma GCC diagnostic not allowed inside functions
    在这里插入图片描述
    使用高版本gcc,4.4.7不行,我用的是4.8版本

6. 参考

  1. postgis相关下载

    1. postgis下载 https://postgis.net/2019/03/PostGIS-2.5.2-2.4.7-2.3.9-Released/
    2. geos下载 https://libgeos.org/usage/download/
    3. libxml2 下载 http://xmlsoft.org/sources/
  2. postgis安装参考

    1. https://blog.csdn.net/dbdeep/article/details/123643043 postgis 安装
    2. https://blog.csdn.net/weixin_47308871/article/details/122152508
    3. https://blog.csdn.net/dbdeep/article/details/123643043

        当然在安装postgis之前需要安装postgresql,如果你还没有安装,可以参考我另一篇记录: centos7 离线安装postgresql

http://www.yayakq.cn/news/779006/

相关文章:

  • 设计视频网站做网站的步骤视频
  • 如何给网站做seo自己建网站需要什么
  • 零基础学网站建设 知乎互联网项目招商加盟
  • 上海网站优化海佛山手机建站模板
  • 无锡高端网站设计公司价格wordpress p=29
  • 高端网站设计v芯hyhyk1推好网站策划常用软件
  • 带有客户案例的网站wordpress中文文章排版插件
  • 网站建设专业学什么在哪里可以学装修设计
  • 网站推广工作内容行情软件app
  • linux搭建个人网站诚信通国际网站怎么做
  • 英文购物网站模板广州网站开发水平广州亦客网络
  • 广州从化网站建设昌邑建设局网站
  • 做网站的公司有哪些怎么拉人做推广
  • 湛江网站制作公司对电子政务网站建设的建议
  • wordpress网站迁移问题全屋定制需要的软件
  • 如何进行网站营销动画制作软件免费
  • 济南网站建设外包公司哪家好wordpress手机号网站
  • 龙华个人网站建设中建集团的重要事件
  • 网站前面的logo标志正在为您跳转中
  • 做网站的主题有哪些运营是做什么的工作
  • 做电影网站 资源怎么存放深圳网站设计收费
  • 北京汉邦未来网站建设有限公司适合手机的网站
  • 网站如何收费360建筑网挂行情
  • 企业网站的开发公司如何注册新公司
  • 网站流量下降原因咋样着做自己的网站
  • 福建泉州做网站公司哪家好苏州保洁公司多少钱一个平方
  • 怎么做网站的后台管理系统体育网站的制作哪里可以做
  • 知名企业门户网站建设联系电话做网站哪家
  • 企业网站设计vue如何网站开发
  • 泰州做网站建设通相似网站