zoukankan      html  css  js  c++  java
  • postgres安装02--postgis

    未完成目标:

      http://www.cnblogs.com/bulvlanshan/p/9002919.html

      1.远程登录

      2.安装postgis-2.2.6

    关于远程访问,只需要改两点,我们不在过多解释

        1.postgresql.conf

        listen_addresses项值设定为“*”

        2.pg_hba.conf

        host all all 127.0.0.1/32 md5

        host    all    all    0.0.0.0/0    md5

    重点postgis安装

      我们选择的版本postgis-2.2.6

      1.安装包  

        yum list|grep libxml2
        yum -y install json-c json-c-devel
        wget http://download.osgeo.org/geos/geos-3.5.1.tar.bz2
        wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz
        wget http://download.osgeo.org/gdal/2.2.0/gdal-2.2.0.tar.gz
        wget https://download.osgeo.org/postgis/source/postgis-2.2.6.tar.gz

      2.安装组件

        cd ../geos-3.5.1/
        ./configure --prefix=/home/postgres/geos
        make  && make install

        cd ../proj-4.9.3/
        ./configure --prefix=/home/postgres/proj4
        make  && make install    

        cd ../gdal-2.2.0

        ./configure --prefix=/home/postgres/gdal --with-pg=/data/pgsql/bin/pg_config

        make  && make install

      3.加载   

        [root@postgres-test01-0001 ~]# vim /etc/ld.so.conf

        include ld.so.conf.d/*.conf
        /home/postgres/lib
        /home/postgres/geos/lib
        /home/postgres/proj4/lib
        /home/postgres/gdal/lib

        /data/pgsql/lib/

        [root@postgres-test01-0001 ~]# ldconfig

      4.最后一步安装postgis

      

        cd ../postgis-2.2.6/
        ./configure --prefix=/home/postgres --with-gdalconfig=/home/postgres/gdal/bin/gdal-config --with-pgconfig=/data/pgsql/bin/pg_config --with-geosconfig=/home/postgres/geos/bin/geos-config --with-projdir=/home/postgres/proj4 --with-gdalconfig
        make && make install

      5.出错情况

      postgis中执行./configure时,遇到 checking for library containing GDALAllRegister... no 

      将postgres库也要加入/etc/ld.so.conf

      /data/pgsql/lib/

      记得要:ldconfig

      测试:

      [root@postgres-test01-0001 postgis-2.2.6]# ldconfig -p | grep libpg
      libpgtypes.so.3 (libc6,x86-64) => /data/pgsql/lib/libpgtypes.so.3
      libpgtypes.so (libc6,x86-64) => /data/pgsql/lib/libpgtypes.so

      6.测试

      命令:

      [postgres@postgres-test01-0001 ~]$ psql
      psql (9.4.16)
      Type "help" for help.

      postgres=# create database gistest;
      CREATE DATABASE
      postgres=# c gistest
      You are now connected to database "gistest" as user "postgres".
      gistest=# CREATE EXTENSION postgis;
      CREATE EXTENSION
      gistest=# CREATE EXTENSION postgis_topology;
      CREATE EXTENSION
      gistest=# SELECT postgis_full_version();
      postgis_full_version

      -------------------------------------------------------------------------------------------------------------------------------------
      ----------------------------------------
      POSTGIS="2.2.6 r16006" GEOS="3.5.1-CAPI-1.9.1 r4246" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.0, released 2017/04/28" LIBXML
      ="2.9.1" LIBJSON="0.11" TOPOLOGY RASTER
      (1 row)

      gistest=#

      

  • 相关阅读:
    cuda、cudnn环境配置
    1.python的 a,b=b,a+b 和 a=b b=a+b 的区别
    例子:循环语句--打印一个菱形
    7.python基础语法--format()函数
    例子:循环语句--九九乘法表
    例子:循环语句--输入N个整数,判断最大值,最小值,和,平均值。
    例子:循环语句--素数问题
    例子:循环语句--打印一个边长为n的正方形。
    例子:循环语句--给定一个不超过5位的正整数,判断该数的位数,依次打印出个位、十位、百位、千位、万位的数字。
    6.python基础语法--循环结构
  • 原文地址:https://www.cnblogs.com/bulvlanshan/p/9002966.html
Copyright © 2011-2022 走看看