greenplum安装postgis功能

1.上传包postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg

2.安装
[gpadmin@mas01 bai]$ 
[gpadmin@mas01 bai]$ gppkg -i /home/gpadmin/bai/postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg 
20180709:14:19:08:091226 gppkg:mas01:gpadmin-[INFO]:-Starting gppkg with args: -i /home/gpadmin/bai/postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg
20180709:14:19:10:091226 gppkg:mas01:gpadmin-[INFO]:-Installing package postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg
20180709:14:19:11:091226 gppkg:mas01:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /opt/greenplum/greenplum-db-4.3.8.0/.tmp/postgis-2.0.3-2.x86_64.rpm /opt/greenplum/greenplum-db-4.3.8.0/.tmp/geos-3.3.8-1.x86_64.rpm /opt/greenplum/greenplum-db-4.3.8.0/.tmp/proj-4.8.0-1.x86_64.rpm --dbpath /opt/greenplum/greenplum-db-4.3.8.0/share/packages/database --prefix /opt/greenplum/greenplum-db-4.3.8.0'
20180709:14:19:17:091226 gppkg:mas01:gpadmin-[INFO]:-Installing postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg locally
20180709:14:19:18:091226 gppkg:mas01:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /opt/greenplum/greenplum-db-4.3.8.0/.tmp/postgis-2.0.3-2.x86_64.rpm /opt/greenplum/greenplum-db-4.3.8.0/.tmp/geos-3.3.8-1.x86_64.rpm /opt/greenplum/greenplum-db-4.3.8.0/.tmp/proj-4.8.0-1.x86_64.rpm --dbpath /opt/greenplum/greenplum-db-4.3.8.0/share/packages/database --prefix /opt/greenplum/greenplum-db-4.3.8.0'
20180709:14:19:18:091226 gppkg:mas01:gpadmin-[INFO]:-Installing rpms cmdStr='rpm -i /opt/greenplum/greenplum-db-4.3.8.0/.tmp/postgis-2.0.3-2.x86_64.rpm /opt/greenplum/greenplum-db-4.3.8.0/.tmp/geos-3.3.8-1.x86_64.rpm /opt/greenplum/greenplum-db-4.3.8.0/.tmp/proj-4.8.0-1.x86_64.rpm --dbpath /opt/greenplum/greenplum-db-4.3.8.0/share/packages/database --prefix=/opt/greenplum/greenplum-db-4.3.8.0'
20180709:14:19:19:091226 gppkg:mas01:gpadmin-[INFO]:-Completed local installation of postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg.
20180709:14:19:19:091226 gppkg:mas01:gpadmin-[INFO]:-Please run psql -d mydatabase -f $GPHOME/share/postgresql/contrib/postgis-2.0/postgis.sql to enable the package.
20180709:14:19:19:091226 gppkg:mas01:gpadmin-[INFO]:-postgis-ossv2.0.3_pv2.0.1_gpdb4.3orca-rhel5-x86_64.gppkg successfully installed.
[gpadmin@mas01 bai]$ 
[gpadmin@mas01 bai]$ 


3.执行sql 
[gpadmin@mas01 bai]$ cd $GPHOME/share/postgresql/contrib/postgis-2.0/
[gpadmin@mas01 postgis-2.0]$ 
[gpadmin@mas01 postgis-2.0]$ 
[gpadmin@mas01 postgis-2.0]$ psql -d xxxdb -f postgis.sql >postgis.sql.log 2>&1 &
[gpadmin@mas01 postgis-2.0]$ psql -d xxxdb -f spatial_ref_sys.sql >spatial_ref_sys.sql.log 2>&1 &

4.检验
[gpadmin@mas01 postgis-2.0]$ 
[gpadmin@mas01 postgis-2.0]$ psql
psql (8.2.15)
Type "help" for help.

xxxdb=# 
xxxdb=# \d
                        List of relations
 Schema |            Name             | Type  |  Owner  | Storage 
--------+-----------------------------+-------+---------+---------
 public | aaadsy1                     | table | zbcs    | heap
 public | aaadsy2                     | table | zbcs    | heap
 public | all_seg_sql                 | view  | gpadmin | none
 public | cw_zczs_zb                  | table | zbcs    | heap
 public | geography_columns           | view  | gpadmin | none                 --新增视图
 public | geometry_columns            | view  | gpadmin | none                 --新增视图
 public | spatial_ref_sys             | table | gpadmin | heap                                 --新增视图
 public | t1                          | table | zbcs    | heap
 public | test                        | table | gpadmin | heap
 
 xxxdb=# 
xxxdb=# select * from spatial_ref_sys limit 5;
 srid | auth_name | auth_srid |                                                                                                                              
                                                      srtext                                                                                                 
                                                                                   |                                proj4text                                
 
------+-----------+-----------+------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------+-------------------------------------------------------------------------
-
 4002 | EPSG      |      4002 | GEOGCS["Unknown datum based upon the Airy Modified 1849 ellipsoid",DATUM["Not_specified_based_on_Airy_Modified_1849_ellipsoid
",SPHEROID["Airy Modified 1849",6377340.189,299.3249646,AUTHORITY["EPSG","7002"]],AUTHORITY["EPSG","6002"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UN
IT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4002"]] | +proj=longlat +ellps=mod_airy +no_defs 
 4183 | EPSG      |      4183 | GEOGCS["Azores Central 1948",DATUM["Azores_Central_Islands_1948",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","
7022"]],TOWGS84[-104,167,-38,0,0,0,0],AUTHORITY["EPSG","6183"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EP
SG","9122"]],AUTHORITY["EPSG","4183"]]                                             | +proj=longlat +ellps=intl +towgs84=-104,167,-38,0,0,0,0 +no_defs 
 4247 | EPSG      |      4247 | GEOGCS["La Canoa",DATUM["La_Canoa",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-273.5,110.6,-
357.9,0,0,0,0],AUTHORITY["EPSG","6247"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY[
"EPSG","4247"]]                                                                    | +proj=longlat +ellps=intl +towgs84=-273.5,110.6,-357.9,0,0,0,0 +no_defs 
 4311 | EPSG      |      4311 | GEOGCS["Zanderij",DATUM["Zanderij",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-265,120,-358,
0,0,0,0],AUTHORITY["EPSG","6311"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG"
,"4311"]]                                                                          | +proj=longlat +ellps=intl +towgs84=-265,120,-358,0,0,0,0 +no_defs 
 4604 | EPSG      |      4604 | GEOGCS["Montserrat 1958",DATUM["Montserrat_1958",SPHEROID["Clarke 1880 (RGS)",6378249.145,293.465,AUTHORITY["EPSG","7012"]],T
OWGS84[174,359,365,0,0,0,0],AUTHORITY["EPSG","6604"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"
]],AUTHORITY["EPSG","4604"]]                                                       | +proj=longlat +ellps=clrk80 +towgs84=174,359,365,0,0,0,0 +no_defs 
(5 rows)

xxxdb=# 
xxxdb=# 
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值