CentOS installation PostGIS

PostgreSQL PostGIS is a plug-in, you need to pay attention to the version matching relation, detailed version matching relation can at the official website ( https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS find on).

1, the installation epel

yum -y install epel-release

2, install PostGIS

The version number format is: before _ to postgis version, back to postgresql version.

yum install postgis2_96

Here is PostGIS2.4 matching version.

3, the new extension 

After installing postgis, you need to activate the PostGIS functions on the database before you can store spatial data before you can use spatial database functionality.

Switching to the operating system user postgres

sudo -i -u postgres

Connect to the database

-bash-4.2$ psql -d scgis

New extension

scgis=# CREATE EXTENSION postgis;

Attached full extension

-- 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;

CREATE EXTENSION ogr_fdw;
CREATE EXTENSION pgrouting;
CREATE EXTENSION pointcloud;
CREATE EXTENSION pointcloud_postgis;

Verify PostGIS version

scgis=# SELECT PostGIS_version();
scgis=# SELECT postgis_full_version();

reference:

https://www.cnblogs.com/giser-s/p/11195697.html

Guess you like

Origin www.cnblogs.com/hans_gis/p/12640656.html