1、安装 PostGIS

我的PostgreSQL版本是 10.4 ,所以 PostGIS安装postgis24_10,(PostGIS 2.4版?适用于PostgreSQL 10 ?)

yum -y install epel-release
yum install postgis24_10 postgis24_10-client -y


2、安装ogrfdw

英文说明为“PostgreSQL foreign data wrapper for OGR”,安装指令:

yum install ogr_fdw10 -y


3、安装pgRouting

英文说明为“Routing functionality for PostGIS”,安装指令:

yum install pgrouting_10 -y

注意:为什么是 pgrouting_10 ?而网上博客多是 pgrouting_95 之类,
因为我的PostgreSQL安装的版本是 10.4,我用 yum serarch pgrouting也只找到这个,正符合!
上面的 “ogr_fdw10” 同理。


4、启用PostGIS扩展

PostGIS是可选扩展,要单独针对某数据库来指定启用(官方网站上说,不要在 postgres这个数据库中启用它)

下面我在名为mydb的数据库中启用PostGIS,相关指令:

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION ogr_fdw;
SELECT postgis_full_version();

执行效果如图:

【GIS部署系列】2、CentOS 7安装PostGIS 2.4,基于PostgreSQL 10(ArcGIS、Mapnik、geoserver、osm2pgsql、OpenLayers)

另外,下面是官方网站点列的一份扩展:

-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
-- Enable Topology
CREATE EXTENSION postgis_topology;
-- Enable PostGIS Advanced 3D
-- and other geoprocessing algorithms
-- sfcgal not available with all distributions
CREATE EXTENSION postgis_sfcgal;
-- fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
-- rule based standardizer
CREATE EXTENSION address_standardizer;
-- example rule data set
CREATE EXTENSION address_standardizer_data_us;
-- Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;


官网相关链接:http://postgis.net/install/


(完)


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-11-30
  • 2021-07-16
  • 2021-08-30
  • 2021-05-09
猜你喜欢
  • 2021-06-25
  • 2021-07-18
  • 2021-12-24
  • 2022-03-09
  • 2021-06-04
  • 2022-02-12
  • 2022-12-23
相关资源
相似解决方案