PostGIS installation in Ubuntu 18.04 LTS “Bionic Beaver”
Recently I have completed one project in Laravel and we have used PostgreSQL database with PostGIS extension and setup on Ubuntu 18.04 so I will guide you how to install PostGIS extension in your Ubuntu system.
PostGIS is open source software program that adds support for geographic objects to the PostgreSQL object-relational database.
Before we jump to the installation part I am assuming that you have already installed latest PostgreSQL.in your system.
Before you can install PostGIS extension, update your list of available packages so the packages from the new repository are added to the list.
sudo apt-get update
Once your sources update, install PostGIS.
sudo apt-get install postgis
Enter Y when prompted to install PostGIS along with its necessary dependencies. Now we can now connect to PostgreSQL and integrate PostGIS.
sudo -i -u postgres
Connect to the
psql -d PostGISDemo
Enable the PostGIS extension on the database:
CREATE EXTENSION postgis;
Let’s verify that everything worked correctly. Execute the following command:
You’ll get this output:
postgis_version --------------------------------------- 2.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 (1 row)
We’re all set. Type
to exit the SQL session and return to your terminal prompt.
Keep visiting for new stuff and give your feedback.
Happy Coding 😉