With PostgreSQL’s introduction of K-Nearest Neighbor searches in version 9.1, it was only a matter of time until PostGIS implemented GiST idexes for its own data types. That time has come with its upcoming 2.0 release. If you’ve got a twitch and want to set it up today, here’s how to get started. (A great many thanks to the manual which got me a large part of the way there)
Start with a vanilla installation of Ubuntu Server (I’m using version 11.10)
**EDIT 28 February 2012:** Link to current snapshot updated.
EDIT 29 February 2012: Added GDAL library dependency.
First, make sure we have the necessary tools installed
Install PostgreSQL 9.1
Normally I would want to get the sources directly from the SVN repository, but I was having trouble building from there. There are snapshots available, however, so lets grab that and use it.
Now lets navigate into the folder so we can build and install PostGIS
Congratulations, PostGIS 2.0 is now installed!
And a quick refresher on setting up a PostGIS database: