Setting up postGIS

From University of Washington - Ubicomp Research Page
Revision as of 20:40, 2 October 2008 by Jonathan Lester (talk | contribs)

Jump to: navigation, search
  • Download postGIS source code from http://postgis.refractions.net/download/
  • Extract and build
    ./configure
    make
    sudo make install
    
  • Install the proj projection library from | http://download.osgeo.org/proj/proj-4.6.1.tar.gz
  • Extract and build
    ./configure
    make
    sudo make install
    
  • Install the GOES gemoetry engine from | http://trac.osgeo.org/geos/
  • Extract and build
    [extract bzip2 -d filename]
    ./configure
    make
    sudo make install
    
  • Install postGIS for Ubuntu from synaptic
  • Create a DB in postgreSQL, and install postGIS
    su postgres
    psql -h ubi.cs.washington.edu -W -d jobDB -U jobAdmin
         CREATE DATABASE "postgis"
           WITH OWNER = "jobAdmin"
                ENCODING = 'UTF8';
    psql -d postgis -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
    
  • Add shape files to DB
    cd /projects/ubicomp99/postgis/bus/data
    # shp2pgsql -D myshape.shp mytable mytestdb | psql mytestdb
    # shp2pgdwl -s [washington coordinate plane] [shape file] [tablename] | psql -d [dbname]
    shp2pgsql -s 2926 Busstop busstop | psql -d postgis
    shp2pgsql -s 2926 routes busroute | psql -d postgis
    shp2pgsql -s 2926 moving_stops moving_stops | psql -d postgis