| 1 | = How to install PostGIS 2.0 on Ubuntu 13.04 (''raring'') from packages = |
| 2 | |
| 3 | == Install == |
| 4 | |
| 5 | Add PPA using: |
| 6 | {{{ |
| 7 | sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable |
| 8 | }}} |
| 9 | Now open 'Software & Updates' and go to the tab 'Other Software' and change the distribution for http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu from 'raring' to 'quantal'. Otherwise you will get the following error message: |
| 10 | {{{ |
| 11 | ERROR: could not open extension control file "/usr/local/PostgreSQL/9.2/share/postgresql/extension/postgis.control": No such file or directory |
| 12 | }}} |
| 13 | Install packages using the following commands: |
| 14 | {{{ |
| 15 | sudo apt-get update |
| 16 | sudo apt-get install postgis postgresql-9.1-postgis |
| 17 | }}} |
| 18 | |
| 19 | |
| 20 | == Spatially enabling a database == |
| 21 | |
| 22 | Connect to your database using pgAdmin or psql, and run the following commands. To add postgis with raster support: |
| 23 | {{{ |
| 24 | CREATE EXTENSION postgis; |
| 25 | }}} |
| 26 | |
| 27 | To add topology support, a second extension can be created on the database: |
| 28 | {{{ |
| 29 | CREATE EXTENSION postgis_topology; |
| 30 | }}} |
| 31 | |
| 32 | == See also == |
| 33 | * https://help.ubuntu.com/community/PostgreSQL |