Changes between Version 1 and Version 2 of UsersWikiPostGIS21Ubuntu1304src


Ignore:
Timestamp:
06/24/13 04:13:05 (12 years ago)
Author:
mwtoews
Comment:

assume raster and extension support

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS21Ubuntu1304src

    v1 v2  
    1 = How to install PostGIS 2.1beta3 on Ubuntu 13.04 (''raring)'') from source =
     1= How to install PostGIS 2.1beta3 on Ubuntu 13.04 (''raring'') from source =
    22
    33== Prerequisites ==
     
    77{{{
    88sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev libgdal-dev libproj-dev libjson0-dev xsltproc docbook-xsl docbook-mathml
    9 }}}
    10 
    11 Optional package for raster support (this is required if you want to build the PostgreSQL extensions):
    12 {{{
    13 sudo apt-get install libgdal-dev
    149}}}
    1510
     
    3631}}}
    3732
    38 PostGIS 2.1 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. Note that raster is required for the extension installation method for PostgreSQL.
     33A basic configuration for PostGIS 2.1, with raster and topology support:
    3934{{{
    4035./configure
     
    5348
    5449== Spatially enabling a database ==
    55 With PostgreSQL 9.1, there are two methods to add PostGIS functionality to a database: using extensions, or using enabler scripts.
    5650
    57 === PostGIS Extension for PostgreSQL ===
    58 Spatially enabling a database using extensions is a new feature of PostgreSQL 9.1.
    59 
    60 Connect to your database using pgAdmin or psql, and run the following commands. To add postgis with raster support:
     51Connect to your database using pgAdminIII or psql, and use the commands to add the PostgreSQL extensions. To add PostGIS with raster support:
    6152{{{
    6253CREATE EXTENSION postgis;
     
    6859}}}
    6960
    70 === Enabler Scripts / Template ===
    71 
    72 Enabler 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.
    73 
    74 The 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.
    75 
    76 PostGIS:
    77 {{{
    78 sudo -u postgres createdb template_postgis
    79 sudo -u postgres psql -d template_postgis -c "UPDATE pg_database SET datistemplate=true WHERE datname='template_postgis'"
    80 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql
    81 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/spatial_ref_sys.sql
    82 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/postgis_comments.sql
    83 }}}
    84 
    85 with raster support:
    86 {{{
    87 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/rtpostgis.sql
    88 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/raster_comments.sql
    89 }}}
    90 
    91 with topology support:
    92 {{{
    93 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/topology.sql
    94 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/topology_comments.sql
    95 }}}
    96 
    9761== See also ==
    9862 * https://help.ubuntu.com/community/PostgreSQL