Atualização para PostGIS 2.0

Da GeoBox

Índice

PostGIS 2.0

Recursos

http://www.wildsong.biz/index.php?title=PostGIS http://trac.osgeo.org/postgis/wiki/UsersWikiPostgisTopology

sudo apt-get install  postgresql-server-dev-9.1
sudo apt-get install python-dev

GEOS

Installed into /usr/local

sudo apt-get install swig php5-dev phpunit
wget http://download.osgeo.org/geos/geos-3.3.2.tar.bz2
tar xjvf geos-3.3.2.tar.bz2 
cd geos-3.3.2
./configure --enable-python --enable-php
make
sudo make install
# Muito importante!
sudo ldconfig

PostGIS 2.0

wget http://postgis.refractions.net/download/postgis-2.0.1SVN.tar.gz
tar -zxvf postgis-2.0.1SVN.tar.gz
 
cd postgis-2.0.1SVN/
./configure
make
sudo make install

É necessário um restart.

sudo su postgres
dropdb template_postgis
 
createdb template_postgis
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql -v ON_ERROR_STOP=1
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql -v ON_ERROR_STOP=1
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology.sql -v ON_ERROR_STOP=1
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql -v ON_ERROR_STOP=1
 
psql template1
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
\c template_postgis
VACUUM FREEZE;
\q
Ferramentas pessoais