Changes between Initial Version and Version 1 of UsersWikiPostGIS20Ubuntu1004src


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

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20Ubuntu1004src

    v1 v1  
     1= How to install PostGIS 2.0 on Ubuntu 10.04 (''lucid'') 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 build-essential postgresql-8.4 postgresql-server-dev-8.4 libxml2-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.2 ===
     27PostGIS 2.0 requires GEOS >= 3.3.2 for topology support, however Ubuntu 10.04 only has GEOS 3.1.0 available in packages, so it needs to be built from source. Even if you don't need topology, you still 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 createlang plpgsql template_postgis
     58sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis.sql
     59sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/spatial_ref_sys.sql
     60sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/postgis_comments.sql
     61}}}
     62
     63=== Enable raster extension ===
     64Adding on to `template_postgis`:
     65{{{
     66sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/rtpostgis.sql
     67sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/raster_comments.sql
     68}}}
     69
     70=== Enable topology extension ===
     71Adding on to `template_postgis`:
     72{{{
     73sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/topology.sql
     74sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/8.4/contrib/postgis-2.0/topology_comments.sql
     75}}}
     76
     77== See also ==
     78 * https://help.ubuntu.com/community/PostgreSQL