• PostGIS 安装教程(Linux)(二)


    ##接上篇,上篇讲述了Postgresql的安装,此篇介绍postgis的安装

    ##附上上篇链接:https://www.cnblogs.com/giser-s/p/11195419.html

    二、安装PostGIS

    1. 安装epel

    #网上资料说,由于2.0中引入了GDAL和JSON等依赖关系,PostGIS有很多依赖关系,因此安装之前需要先安装依赖项。

    [root@psql_master ~]# yum -y install epel-release

    2. 安装PostGIS

    #版本号格式为:_前为postgis版本,后面为postgresql版本(这里是网上的说法,暂时还没验证,本想装postgis2.2,可是这个命令下装的是2.4,具体什么原因待研究)

    [root@psql_master ~]# sudo yum install postgis2_94

    #实验证明如果要装postgis2.2版本,可以命令改为

    [root@psql_master ~]# sudo yum install postgis22_94

     

     

    3. 新建扩展

    #安装完postgis后,并不表示可以使用空间数据库功能了,需要先激活数据库上的PostGIS功能,然后才能存储空间数据

    1)先切换到用户

    [root@psql_master ~]# sudo -i -u postgres

    2)创建测试用户/数据库

    -bash-4.2$ createuser test_user

    -bash-4.2$ createdb test_db -O test_user

    #上面创建test_db命令 -o是英文字母o,不是零

    3)连接到测试数据库

    -bash-4.2$ psql -d test_db

    4)在数据库上启用PostGIS扩展

    test_db=# CREATE EXTENSION postgis;

    5)验证

    test_db=# SELECT PostGIS_version();

    4. 将Arcgis安装目录下的so文件,复制到linux下postgresql安装目录lib下(/usr/pgsql-9.4/lib)

    4. 至此结束

    #arcsde连postgis,与windows下无异,参照https://www.cnblogs.com/giser-s/p/10345285.html(方法二)




  • 相关阅读:
    用户模板和用户场景
    人月神话阅读笔记02
    人月神话阅读笔记01
    软件工程周总结07
    NABCD
    软件工程周总结06
    软件工程周总结05
    tomcat端口被占用
    SQLyog出现2003错
    一维最大子数组和(续)
  • 原文地址:https://www.cnblogs.com/giser-s/p/11195697.html
Copyright © 2020-2023  润新知