Changes between Initial Version and Version 1 of UsersWikiPostGIS20Debian70src


Ignore:
Timestamp:
May 24, 2012, 1:49:02 AM (12 years ago)
Author:
Mike Taves
Comment:

start instructions .. not tested yet!

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Debian70src

    v1 v1  
     1= How to install PostGIS 2.0 on Debian 7.0 (''wheezy'') from source =
     2
     3== Prerequisites ==
     4
     5Several components are needed, which can either be built from source or installed from pre-built packages, as shown below. It is assumed you have already installed and configured `sudo` (not done by default).
     6
     7Install prerequisite packages using:
     8{{{
     9sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev libgeos-dev xsltproc docbook-xsl docbook-mathml
     10}}}
     11
     12Optional package for raster support (recommended):
     13{{{
     14sudo apt-get install libgdal-dev
     15}}}
     16
     17== Build PostGIS ==
     18{{{
     19wget http://postgis.refractions.net/download/postgis-2.0.0.tar.gz
     20tar xfvz postgis-2.0.0.tar.gz
     21cd postgis-2.0.0
     22}}}
     23PostGIS 2.0 can be configured to disable topology or raster extensions, using the configure flags `--without-raster` and `--without-topology`. The default is to build both extensions:
     24{{{
     25./configure
     26make
     27sudo make install
     28sudo ldconfig
     29sudo make comments-install
     30}}}
     31
     32Lastly, enable the command-line tools to work from your shell:
     33{{{
     34sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/shp2pgsql
     35sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/pgsql2shp
     36sudo ln -sf /usr/share/postgresql-common/pg_wrapper /usr/local/bin/raster2pgsql
     37}}}
     38
     39== Using enabler scripts ==
     40
     41Enabler scripts can be used to either build a template, or directly spatially enable a database.
     42
     43The following example creates a template, which can be re-used for creating multiple spatially-enabled databases. Or if you just want to make one spatially enabled database, you can modify the commands for your needs.
     44
     45Log-in as `postgres` from `root` using "`su - postgres`", and use the following commands. Install PostGIS:
     46{{{
     47createdb template_postgis
     48createlang plpgsql template_postgis
     49psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql
     50psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql
     51psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis_comments.sql
     52}}}
     53
     54with raster support:
     55{{{
     56psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql
     57psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/raster_comments.sql
     58}}}
     59
     60with topology support:
     61{{{
     62psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology.sql
     63psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology_comments.sql
     64}}}