Install PostGIS 3.x on CentOS 8

This post will cover install PostGIS 3.x on CentOS 8.

If you do not already have PostgreSQL 12 installed, do so here

PostGIS 3.x requires additional packages not available in the PostgreSQL repository.

Install the Epel repository for these dependencies:

With Epel installed, we can now use Yum to install the PostGIS 3.x packages from the PostgreSQL Repository:

Once completed, su to postgres and connect to the target database where you wish to enable PostGIS.

Below, we are using database ‘demo’:

Install the PostGIS extension using CREATE EXTENSION:

Check the PostGIS version installed:

Lets test out our extension using a basic example from https://postgis.net/docs/using_postgis_dbmanagement.html

Create a table with a GEOGRAPHY column:

Insert some data:

Select the name column values:

And run a Spatial Query:

Learn more at https://postgis.net/

 

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.