Install PostGIS 3.0 on CentOS 8 with PostgreSQL 12

Install PostgreSQL 12

Install and enable EPEL and PowerTools repositories if not already enabled.

Install PostGIS for PostgreSQL 12:

# dnf -y install postgis30_12

Enable PostGIS Spatial features

Switch to postgres user

# su - postgres

Create test user/database.

$ createuser gisuser
$ createdb gisdb -O gisuser

Connect to the test database

$ psql -d gisdb

Enable the PostGIS extension on the database (as of 3.0 contains just geometry/geography)

gisdb=# CREATE EXTENSION postgis;

Enable raster support (for 3+)

gisdb=# CREATE EXTENSION postgis_raster;

Enable topology

gisdb=# CREATE EXTENSION postgis_topology;

Enable PostGIS Advanced 3D and other geoprocessing algorithms sfcgal not available with all distributions

gisdb=# CREATE EXTENSION postgis_sfcgal;

Enable fuzzy matching needed for Tiger

gisdb=# CREATE EXTENSION fuzzystrmatch;

Enable rule-based standardizer

gisdb=# CREATE EXTENSION address_standardizer;

Enable example rule data set

gisdb=# CREATE EXTENSION address_standardizer_data_us;

Enable US Tiger Geocoder

gisdb=# CREATE EXTENSION postgis_tiger_geocoder;

Verify it is enabled

gisdb=# SELECT PostGIS_version();

Upgrading PostGIS

gisdb=# ALTER EXTENSION postgis UPDATE;
gisdb=# ALTER EXTENSION postgis_topology UPDATE;

 

Leave a Reply

Your email address will not be published. Required fields are marked *