PostGIS - can't create spatially-enabled database
I'm using Ubuntu 10.10, PostgreSQL 9.0 and PostGIS 1.5.
I've installed PostGIS 1.5 from: https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable
I used PPA first then the command:
sudo apt-get install postgis
to install postgis. I've been following these instructions to create a spatially-enabled database:
http://ostgis.refractions.net/docs/ch02.html
I got to the point where it's saying:
Now load the PostGIS object and function definitions into your database by loading the postgis.sql definitions file (located in [prefix]/share/contrib as specified during the configuration step).
psql -d [yo开发者_如何转开发urdatabase] -f postgis.sql
Well, there is no postgis.sql on my server after the installation. I did an sudo updatedb to make sure I can find postgis.sql but it's not there. Any ideas? Thank you!
The "ubuntugis-unstable" PPA repository that you're using does not ship PostGIS for PostgreSQL 9.0. It includes a package named "postgresql-8.4-postgis
", which contains the file /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
. This is what they're referring to.
Unfortunately, the PPA does not include a version of the PostGIS extension for PostgreSQL 9.0 because 9.0 isn't yet shipped with any Ubuntu release. It will be included in the upcoming Ubuntu 11.04 Natty, which will probably also ship an up-to-date PostGIS in the official repositories.
So, you can follow these instructions to build your own PostGIS, or stick with PostgreSQL 8.4 from the official repos.
edit: ubuntu 11.04 don't ship postgres 9.0
The newers Postgres and Postgis versions that work with it are available from
https://launchpad.net/~pitti/+archive/postgresql/+packages
Following this guide that incorporates all needed software for PostGIS, you can set it up easily. It's for 10.04 but the PPA works with 10.10 as well.
I'd recommend 9.x and the latest PostGIS since we had severe (known) speed problems for a project. SO choose either 8.3 or 9.0.
There is a tutorial for PostGIS 8.4 on Ubuntu 10.10 here.
精彩评论