Ubuntu 12.04 部署 PostGIS 2.1

首先,卸载掉原有的postgis和postgresql-9.1-postgis,不然你就用1.5版好了~
sudo dpkg --purge postgis postgresql-9.1-postgis
然后,添加相应的repository 并安装PostGIS
sudo apt-add-repository ppa:sharpie/for-science  # To get GEOS 3.3.2 
sudo apt-add-repository ppa:sharpie/postgis-nightly
sudo apt-get update
sudo apt-get install postgresql-9.1-postgis
接着生成postgis模板库
sudo su postgres
createdb postgis_template
psql -d postgis_template -f /usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql  
psql -d postgis_template -f /usr/share/postgresql/9.1/contrib/postgis-2.1/spatial_ref_sys.sql
最后,修改一下用户密码
psql  
ALTER USER postgres WITH PASSWORD '123456';
OK了,去体验 postgis强大的空间能力吧!

你可能感兴趣的:(Ubuntu 12.04 部署 PostGIS 2.1)