Created
February 18, 2017 05:22
-
-
Save rana-ahmed/177d24134d1eaa4f2da7f9b1c824e7cc to your computer and use it in GitHub Desktop.
Install postgres gis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #install postgres | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| sudo apt-get -y install postgresql-9.5 python-psycopg2 | |
| #install postgis | |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt xenial-pgdg main" >> /etc/apt/sources.list' | |
| wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get install postgresql-9.5-postgis-2.2 postgresql-contrib-9.5 | |
| #activate gis on a database | |
| sudo su - postgres | |
| psql -c "create user root with password 'root'" | |
| psql -c "create database geodata encoding 'utf-8' owner root" | |
| psql | |
| \connect geodata; | |
| CREATE EXTENSION postgis; | |
| SELECT postgis_full_version(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment