Changes between Version 1 and Version 2 of UsersWikiPostGIS21Ubuntu1304src
- Timestamp:
- 06/24/13 04:13:05 (11 years ago)
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 = 2 2 3 3 == Prerequisites == … … 7 7 {{{ 8 8 sudo 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-dev14 9 }}} 15 10 … … 36 31 }}} 37 32 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. 33 A basic configuration for PostGIS 2.1, with raster and topology support: 39 34 {{{ 40 35 ./configure … … 53 48 54 49 == 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.56 50 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: 51 Connect to your database using pgAdminIII or psql, and use the commands to add the PostgreSQL extensions. To add PostGIS with raster support: 61 52 {{{ 62 53 CREATE EXTENSION postgis; … … 68 59 }}} 69 60 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_postgis79 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.sql81 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/spatial_ref_sys.sql82 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/postgis_comments.sql83 }}}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.sql88 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/raster_comments.sql89 }}}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.sql94 sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/topology_comments.sql95 }}}96 97 61 == See also == 98 62 * https://help.ubuntu.com/community/PostgreSQL