Using QGIS and Amazon Aurora PostgreSQL & PostGIS to Display Location Data
Yasunori Kirimoto
Posted on November 3, 2021
I used QGIS and Amazon Aurora PostgreSQL & PostGIS to display location data 🎉
I remembered that I wrote an article, "I tried to display location data using QGIS and Cloud SQL PostgreSQL & PostGIS," about two years ago. This time, I tried to build PostgreSQL & PostGIS database with Amazon Aurora and display it with QGIS!
Configure Amazon Aurora
To begin, create a database in Amazon Aurora.
In the AWS console, go to Amazon RDS and click "Create Database." Next, select Standard Creation, Amazon Aurora, PostgreSQL, Provisioned, PostgreSQL 13.3, and Development/Testing.
Set the DB cluster name, user name, and password. Otherwise, set to default.
Set public access, create a new security group, and put the initial database name. All other settings are default. Although it will not be used in the production environment, it can be accessed directly from the local PC by setting it to Public Access.
After the database is created, click Cluster.
Copy the endpoint as it will be needed for the host information.
This completes the configuration of Amazon Aurora 👍
Configure PostGIS
The next step is to install PostGIS and import the GIS data.
This time we will use DBeaver to connect to Amazon Aurora. Set the endpoint, port, database name, user name, and password you copied to the hostname.
After connecting to Amazon Aurora, install PostGIS.
CREATE EXTENSION postgis;
Verify that it is installed.
SELECT postgis_version();
As for importing data, I imported 1 million point data.
Regarding the import method, I imported the data with the DB manager of QGIS. Still, I could not import the data correctly with Amazon RDS as I wrote in the previous article. This time, I used "shp2pgsql" to import the data.
This completes the configuration of PostGIS 👍
Display in QGIS
Finally, connect to Amazon Aurora in QGIS and display the data.
Layer → Data Source Manager
Set the endpoint, port, database name, user name, and password that you copied to the hostname, and connect to Amazon Aurora.
Select and add the imported data.
You can see one million data displayed in real-time.
I was able to display location data using QGIS and Amazon Aurora PostgreSQL & PostGIS 👍
By using QGIS and Amazon Aurora, I checked the data directly from my local PC. This seems to be a good use when you want to share data within your company, etc.! However, I think the disadvantage is a pay-as-you-go fee, unlike preparing a DB locally.
I want to try PostgreSQL & PostGIS in Amazon RDS in the future 💪
Posted on November 3, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 3, 2021