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