Skip to content
This repository was archived by the owner on Nov 28, 2019. It is now read-only.

How to setup the data importing script

mbainrot edited this page Jul 12, 2014 · 9 revisions

Preface

In this document we will cover the initial setup of a basic environment required to fix minor issues with the upstream data from act art

Prerequisites

Preparing the environment

  1. Perform the following

apt-get install postgresql-9.1-postgis

su postgis

createdb "postgis_template"

cd /usr/share/postgresql/9.1/contrib/postgis-1.5

psql -d postgis_template -f postgis.sql

psql -d postgis_template -f spartial_ref_sys.sql

createdb -T postgis_template abs_sa1

  1. nano /etc/postgresql/9.1/main/pg_hba.conf Locate line which has:

local all postgres user

And change it to

local all postgres trust

  1. Setup additional dependancies (NB: These dependencies can be setup inside of a python virtual environment)

apt-get install postgresql-server-dev-9.1

pip install psycopg2

Populating the database

su postgres mkdir /abs_sa1 cd /abs_sa1 unzip ~/Downloads/1270055001_sa1_2011_aust_shape.zip shp2pgsql -s SRID /abs_sa1/SA1_2011_AUST.shp | psql -d abs_sa1 postgres

Clone this wiki locally