Hello everyone, today I will continue the PostgreSQL tutorial. I am going to show you how to install PostGIS on macOS Catalina. PostGIS is the popular spatial database extension for PostgreSQL Server. With this plugin, we can store our spatial datasets into PostgreSQL database. First, you will need to install and configure the PostgreSQL Server on macOS Catalina. For your information, I have a macOS Catalina Hackintosh running on AMD Ryzen 3.
Steps to Install PostGIS on macOS Catalina
Step 1. Install Homebrew
If you follow my previous tutorial to install PostgreSQL on macOS Catalina, you can skip this step. To install Homebrew on macOS, simply copy and paste this command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Step 2. Install PostgreSQL on macOS Catalina
I have explained more details about how to install and configure PostgreSQL on macOS Catalina in this post. Skip this step if you have the server up and running.
brew install postgresql
Now lets start the server
brew services start postgresql
Now the server should be up and running.
Step 3. Install PostGIS on macOS Catalina
OK so now we are going to install the postgis on our macOS. We will use the brew command to install this.
brew install postgis
Wait until the installation completes.
Step 4. Enable postgis on the PostgreSQL Database
Now we are ready to enable postgis plugin on our database. I am going to use Postbird to do this. You can use PgAdmin or any other PostgreSQL database management software to do this.
Login to the server
Then, select the database from the list. Or, you can create a new database if you don’t have it yet. Click the little PostgreSQL Extension button on the bottom of the Postbird window. You will see a bunch of extensions installed on your system. Scroll down until you see postgis on the list. Click Install to install it to the selected database.
Once installed, refresh the database list. You should see some new tables created automatically.
Done. At this point, we have successfully installed the PostgreSQL server as well as the postgis extension on macOS Catalina. I have tested this to work on my system. I can now connect the postgis database from my QGIS software.