Skip to content

Instantly share code, notes, and snippets.

@rana-ahmed
Created February 18, 2017 05:22
Show Gist options
  • Select an option

  • Save rana-ahmed/177d24134d1eaa4f2da7f9b1c824e7cc to your computer and use it in GitHub Desktop.

Select an option

Save rana-ahmed/177d24134d1eaa4f2da7f9b1c824e7cc to your computer and use it in GitHub Desktop.
Install postgres gis
#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