No worries... This is how I got it installed and running in a pre-existing database.:
First upgrade to the latest version of Ubuntu. At the moment it's 12.10 (quantal). You can find your current version by typing lsb_release -a at the command line.
Backup whatever database you want to upgrade:
pg_dump -Fc -b -v -f fb_19jan2012.backup fbPurge the old install of postgis
sudo aptitude purge postgisInstall the Ubuntu gis repo from the Ubuntu GIS group and update. At the moment you have to install the unstable version in order for it to work with quantal.
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo aptitude update
Install the new postgis. It should automatically choose the new version. It actually conflicts with the older version... But doesn't seem to complain about it.
Now we can stuff the backup into our new database with the handy perl command, postgis_restore.pl, that came with the install. Make sure you get out of the postgres account first.
Then I was able to load a digital elevation model raster like this.
TADA!
sudo aptitude install postgisSetup a new database. I'm calling it fb2.
sudo su postgres
createdb fb2
psql -d fb2 -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql
psql -d fb2 -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql
psql -d fb2 -f /usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql
psql -d fb2 -f /usr/share/postgresql/9.1/contrib/postgis_comments.sql
psql -d fb2 -c "grant all privileges on database fb2 to some_user"
Now we can stuff the backup into our new database with the handy perl command, postgis_restore.pl, that came with the install. Make sure you get out of the postgres account first.
exitHappy day! PostGIS 2.0 is installed on our database.
/usr/share/postgresql/9.1/contrib/postgis-2.0/postgis_restore.pl fb_19jan2012.backup | psql fb2
Then I was able to load a digital elevation model raster like this.
raster2pgsql -s 4326 -I -M -C -t 25x25 dem_wa.tif dem_wa > dem_wa.sql
psql fb2 < dem_wa.sql
TADA!
The first raster layer in the new PostGIS 2.0 database. Displayed with qGIS. |
No comments:
Post a Comment