In this tutorial we will use pgAdmin4 because the GUI is easy to understand. To create new database right click on server then click Create > Database

image

I name this database as poi

image

Click on sql tools to use query on this database

image

Type this to enable postgis on the database:

CREATE EXTENSION postgis;

Click run button or just press F5 To check if postgis is enabled you can use this:

SELECT postgis_full_version();

Import Shapefile

You can use this to import shapefile into your database:

export PGPASSWORD=mydatabasepassword
ogr2ogr -f "PostgreSQL" PG:"dbname=poi user=postgres" -nlt PGEOMETRY /path/to/file.shp

You can view the table you just create on Schemas > Public > Tables Right click and view data. You can view your entire table.

image


<
Previous Post
Postgresql Postgis Pgrouting Linux
>
Next Post
Membuat Basis Data Spasial dengan PostgreSQL