Reprint please indicate original author (think8848) and provenance (http://think8848.cnblogs.com)
This article references the installation instructions for the "an almost Idiot's Guide to installation PostgreSQL 9.5, PostGIS 2.2 and pgrouting 2.1.0 with Yum" and the official PostGIS website.
1. Install PostgreSQL First
See "Installing and simply setting up PostgreSQL notes" under CentOS7
2. First install a few later on the use of the kit, so as not to use the time and no
sudo yum install wget net-tools epel-release-y
3. Installing PostGIS
sudo yum install postgis2_95 postgis2_95-client-y
Postgis2_95-client contains the PostGIS of the naming line tools, such as: Shp2pgsql,pgsql2shp,raster2pgsql, and so on, see the name also probably know what meaning.
4. Installing OGRFDW
The full name of OGRFDW is ogr Foreign Data Wrapper
sudo yum install ogr_fdw95-y
For more OGR_FDW information, please see here
5. Installing pgrouting
sudo yum install pgrouting_95-y
6. Create a PostgreSQL database and install the PostGIS extension
# switch to the Postgres user first, and then connect to the Postgres database su postgrespsql # Create a new database, specifying that the database owner is think8848 CREATE DATABASE chinaosmgisdb OWNER think8848 # View the list of databases \l # switch to the CHINAOSMGISDB database \c Chinaosmgisdb
Installing the PostGIS Extension
CREATE EXTENSION PostGIS; CREATE EXTENSION postgis_topology; CREATE EXTENSION OGR_FDW;
Extended List of PostGIS
--Enable PostGIS (includes raster)CREATEEXTENSION PostGIS;--Enable TopologyCREATEEXTENSION postgis_topology;--Enable PostGIS Advanced 3D--and other geoprocessing algorithms--Sfcgal not available with all distributionsCREATEEXTENSION Postgis_sfcgal;--fuzzy matching needed for TigerCREATEEXTENSION Fuzzystrmatch;--rule based StandardizerCREATEEXTENSION Address_standardizer;--example rule data setCREATEEXTENSION Address_standardizer_data_us;--Enable US Tiger GeocoderCREATEEXTENSION Postgis_tiger_geocoder;
7. Verifying the installation results
SELECT postgis_full_version ();
If the version information can be displayed successfully, the PostGIS is successfully installed.
Original CentOS7 Deployment PostGIS