Installing PostGis and QGis, first GeoDataBase and Simple Insert

ab0nilla

Alejandro Bonilla

Posted on June 6, 2019

Installing PostGis and QGis, first GeoDataBase and Simple Insert

Hi!, I have a longer time without write a post ... ups xD.

Today I write a little post explain you: How I installed PostGis plugin, create geometry table, and insert data.

Fast Specs in my server: Centos 7 minimal install, Postgres 11.
Fast Specs in my Macbook: PgAdmin 4, QGis.

Step 1: Install PostGis Plugin.

# yum install postgis2_11  
Enter fullscreen mode Exit fullscreen mode

important!!! : the latest number its your Postgres Version in your server.

Step 2: SQL time.

I use PgAdmin because my team its a non-programmer or technical users, maybe I write a post explain this.

2.1 : Create Database

2.2 : Run the script on "Enabling PostGIS" section: https://postgis.net/install/

2.3 : Create a simple Geo Table on public schema:

CREATE TABLE TABLEOFPOINTS
(
    id serial,
    Place character varying COLLATE pg_catalog."default" NOT NULL,
    dir character varying COLLATE pg_catalog."default",
    geog geography(Point,4326) NOT NULL,
    CONSTRAINT TABLEOFPINTS_pkey PRIMARY KEY (id)
)
Enter fullscreen mode Exit fullscreen mode

Okay, Now you have a simple points table; NOT POLYGONAL.

Step 3: Run QGis (I running on 3.4) and connect to PostGis

Step 4: Install OpenLayers

4.1: Enable experimental and deprecated plugins

Plugins->Manage and install plugins->Settings

4.2 Search and Install OpenLayers

Plugins->Manage and install plugins->All

4.3 Add OpenLayers plugin to project

Web->OpenLayers Plugin->OpenStreetMap->OpenStreetMap

Step 5: Add your Point Layer (Postgres spacial table)

Step 6: Make Points

First make sure you have chosen the layer "TABLEOFPOINTS"

1- Click on Pencil icon (Toggle edit).
2- Click on "Add Point feature", and add your points.
3- Complete your data info and click on "Save Layer edit" icon

Ok, if I'am a good teacher you can create spatial database of point, basic use of Qgis and connect at your first Geo Table; finally add points at your database.

The next week, I need use the Geo table to show points using NodeJS and VUE. I hope, this post has been useful for you and also listen to any suggestions for use in node and vue

💖 💪 🙅 🚩
ab0nilla
Alejandro Bonilla

Posted on June 6, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related