0% found this document useful (0 votes)
54 views2 pages

Before Adding PostGIS Extension To Postgres

To add the PostGIS extension to Postgres, one must first install PostGIS on Ubuntu. This involves adding the PostGIS PPA, updating apt, and installing PostGIS with apt-get. After installing, PostGIS can be enabled for a specific database by connecting to it in psql and running commands to create the PostGIS and PostGIS topology extensions.

Uploaded by

eliaezekiel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

Before Adding PostGIS Extension To Postgres

To add the PostGIS extension to Postgres, one must first install PostGIS on Ubuntu. This involves adding the PostGIS PPA, updating apt, and installing PostGIS with apt-get. After installing, PostGIS can be enabled for a specific database by connecting to it in psql and running commands to create the PostGIS and PostGIS topology extensions.

Uploaded by

eliaezekiel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Before adding PostGIS extension to Postgres. You first need to install PostGIS on Ubuntu 14.

04

Add PPA from terminal

$ sudo add-apt-repository ppa:ubuntugis/ppa


$ sudo apt-get update
Install PostGIS with apt-get

$ sudo apt-get install postgis


After successful installation open psql

$ sudo -u postgres psql


List all databases

postgres=# \l
Connect to specific database

postgres=# \c DATABASE_NAME
Run the following to add PostGIS extension to Postgres

CREATE EXTENSION postgis;


CREATE EXTENSION postgis_topology;
Exit from psql

postgres=# \q
Thank you

Logs

Connecting: host=localhost port=5432 user=postgres password='********' dbname=postgis_4g_tdd


client_encoding=UTF8

Connection succeeded.

Connecting: host=localhost port=5432 user=postgres password='********' dbname=postgis_4g_tdd


client_encoding=UTF8

==============================

Importing with configuration: couverture_4g_tdd_outdoor_100, public, geom, C:\Users\mma\


Documents\Projet_TDD\4G TDD\Couverture_4G_TDD_outdoor_100.shp, mode=c, dump=1,
simple=0, geography=0, index=1, shape=1, srid=0

Shapefile type: Polygon

PostGIS type: MULTIPOLYGON[2]

COPY failed with the following error: ERREUR: syntaxe en entrée invalide pour l'entier : « -100.00000
»
CONTEXT: COPY couverture_4g_tdd_outdoor_100, ligne 1, colonne threshold : « -100.00000 »

Shapefile import failed.

CREATE DATABASE postgis_4g_tdd

WITH OWNER = postgres

ENCODING = 'UTF8'

TABLESPACE = pg_default

LC_COLLATE = 'French_France.1252'

LC_CTYPE = 'French_France.1252'

CONNECTION LIMIT = -1;

ALTER DATABASE postgis_4g_tdd

SET search_path = "$user", public, topology, tiger;

You might also like