Changes between Initial Version and Version 1 of UsersWikiPostGIS20Ubuntu1110src


Ignore:
Timestamp:
Mar 6, 2012, 2:07:26 AM (12 years ago)
Author:
Mike Taves
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Ubuntu1110src

    v1 v1  
     1= How to install PostGIS 2.0 on Ubuntu 11.10 (''oneiric'') from source =
     2
     3== Prerequisites ==
     4Several components are needed, which can either be built from source or installed from pre-built packages, as shown below.
     5
     6Install prerequisite packages using:
     7{{{
     8sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev libgeos-dev proj libjson0-dev
     9}}}
     10
     11Optional package for raster support:
     12{{{
     13sudo apt-get install libgdal-dev
     14}}}
     15
     16Optional packages for testing PostGIS:
     17{{{
     18sudo apt-get install libcunit1-dev
     19}}}
     20Optional packages for building documentation:
     21{{{
     22sudo apt-get install xsltproc docbook-xsl imagemagick
     23}}}
     24(for building PDF documentation, add `dblatex`, but expect a large download)
     25
     26=== Build GEOS 3.3.x ===
     27PostGIS 2.0 requires GEOS >= 3.3.2 for topology support, however Ubuntu 11.10 only has GEOS 3.2.2 available in packages, so it needs to be built from source. If you don't need topology, you don't need to build this package.
     28
     29There are multiple ways to build GEOS, but this is the simplest:
     30{{{
     31wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
     32tar xvfj geos-3.3.2.tar.bz2
     33cd geos-3.3.2
     34./configure
     35make
     36sudo make install
     37}}}
     38
     39== Build PostGIS ==
     40{{{
     41wget http://postgis.refractions.net/download/postgis-2.0.0beta2SVN.tar.gz
     42tar xfvz postgis-2.0.0beta2SVN.tar.gz
     43cd postgis-2.0.0beta2SVN
     44}}}
     45PostGIS 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:
     46{{{
     47./configure
     48make
     49sudo make install
     50sudo make comments-install
     51}}}
     52
     53== Template ==
     54Complete 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.
     55{{{
     56sudo -u postgres createdb template_postgis
     57sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql
     58sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql
     59sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis_comments.sql
     60}}}
     61
     62=== Enable raster extension ===
     63Adding on to `template_postgis`:
     64{{{
     65sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql
     66sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/raster_comments.sql
     67}}}
     68
     69=== Enable topology extension ===
     70Adding on to `template_postgis`:
     71{{{
     72sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology.sql
     73sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology_comments.sql
     74}}}
     75
     76== See also ==
     77 * https://help.ubuntu.com/community/PostgreSQL