Changes between Version 3 and Version 4 of UsersWikiPostGIS20Ubuntu1110src


Ignore:
Timestamp:
Apr 3, 2012, 12:54:25 AM (10 years ago)
Author:
Mike Taves
Comment:

remove some prerequisite packages; add extensions

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Ubuntu1110src

    v3 v4  
    66Install prerequisite packages using:
    77{{{
    8 sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev
     8sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev proj libjson0-dev xsltproc docbook-xsl docbook-mathml
    99}}}
    1010
    11 Optional package for raster support:
     11Optional package for raster support (this is required if you want to build the PostgreSQL extensions):
    1212{{{
    1313sudo apt-get install libgdal-dev
    1414}}}
    15 
    16 Optional packages for testing PostGIS:
    17 {{{
    18 sudo apt-get install libcunit1-dev
    19 }}}
    20 Optional packages for building documentation:
    21 {{{
    22 sudo apt-get install xsltproc docbook-xsl docbook-mathml imagemagick
    23 }}}
    24 (for building PDF documentation, add `dblatex`, but expect a large download)
    2515
    2616=== Build GEOS 3.3.x ===
     
    2919There are multiple ways to build GEOS, but this is the simplest:
    3020{{{
    31 wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
    32 tar xvfj geos-3.3.2.tar.bz2
    33 cd geos-3.3.2
     21wget http://download.osgeo.org/geos/geos-3.3.3.tar.bz2
     22tar xvfj geos-3.3.3.tar.bz2
     23cd geos-3.3.3
    3424./configure
    3525make
     
    4030== Build PostGIS ==
    4131{{{
    42 wget http://postgis.refractions.net/download/postgis-2.0.0beta4.tar.gz
    43 tar xfvz postgis-2.0.0beta4.tar.gz
    44 cd postgis-2.0.0beta4
     32wget http://postgis.refractions.net/download/postgis-2.0.0rc2.tar.gz
     33tar xfvz postgis-2.0.0rc2.tar.gz
     34cd postgis-2.0.0rc2
    4535}}}
    46 PostGIS 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:
     36
     37PostGIS 2.0 can be configured to disable topology or raster components, using the configure flags `--without-raster` and/or `--without-topology`. The default is to build both extensions. Note that raster is required for the extension installation method for PostgreSQL.
    4738{{{
    4839./configure
     
    6051}}}
    6152
    62 == Template ==
    63 Complete a post-install by creating 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.
     53== Spatially enabling a database ==
     54With PostgreSQL 9.1, there are two methods to add PostGIS functionality to a database: using extensions, or using enabler scripts.
     55
     56=== PostGIS Extension for PostgreSQL ===
     57Spatially enabling a database using extensions is a new feature of PostgreSQL 9.1.
     58
     59Connect to your database using pgAdmin or psql, and run the following commands. To add postgis with raster support:
     60{{{
     61CREATE EXTENSION postgis;
     62}}}
     63
     64To add topology support, a second extension can be created on the database:
     65{{{
     66CREATE EXTENSION postgis_topology;
     67}}}
     68
     69== Enabler Scripts / Template ==
     70
     71Enabler scripts can be used to either build a template, or directly spatially enable a database. This method is older than the extension method, but is required if the raster support is not built.
     72
     73The 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.
     74
     75PostGIS:
    6476{{{
    6577sudo -u postgres createdb template_postgis
     
    6981}}}
    7082
    71 === Enable raster extension ===
    72 Adding on to `template_postgis`:
     83with raster support:
    7384{{{
    7485sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql
     
    7687}}}
    7788
    78 === Enable topology extension ===
    79 Adding on to `template_postgis`:
     89with topology support:
    8090{{{
    8191sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology.sql