日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

postgres安装02--postgis

發布時間:2025/3/20 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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=#

  

?

轉載于:https://www.cnblogs.com/bulvlanshan/p/9002966.html

總結

以上是生活随笔為你收集整理的postgres安装02--postgis的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。