The first thing I did was set up the enviroment. This is:

  1. Install PostgreSQL 8.3 using apt-get (Debian rulez :-))
  2. Checkout the last version of PROJ.4 (required by PostGIS) from svn by svn checkout, and compile it
  3. Checkout the last version of GEOS (required by PostGIS) from svn by svn checkout geos-svn, and compile it
  4. Checkout the last version of PostGIS from svn by svn checkout postgis-svn, and compile it
  5. Checkout the last version of WKT Raster from svn by svn checkout, and compile it
  6. Export the last version of GDAL from svn by svn export gdal, and compile it

UPDATE 2010/05/02: To compile PostGIS properly, you’ll need a parser generator compatible with yacc. My choice was bison. You can install it, in Debian-based systems, with

sudo apt-get install bison.

You will need libxml2 if you compile PostGIS 1.5+. To install it with apt:

sudo apt-get install libxml2 libxml2-dev

You can install PostgreSQL 8.4 instead of 8.3 too. And it’s recomended to install GEOS version 3.1.1+, to work with PostGIS 1.5+. Further information here. Last, but not least, you’ll need to activate your database to use PostGIS, and do some management. Here a good tutorial to do it in Ubuntu.

UPDATE 2009/11/18: I added this in other post, but here is more useful: After install everything, add the directory (/usr/local/lib) to /etc/ and execute

sudo ldconfig

UPDATE 2009/06/18: I exported the code from GDAL, instead of checkout it.  I’m going to import my own version of GDAL, with the WKT Raster, in a different svn repository. So, after that, I’ve installed:

  • PostreSQL v8.3.
  • PostGIS v1.4.0SVN. I created gsoc09_test database and added spatial capabilities.
  • WKT Raster v0.1.6SVN[1]. I executed the enabler script in order to enable gsoc09_test database to use the wktraster
  • GDAL v1.7.0SVN.

I had two problems, solved, in this process: When I was running the enabler script to add the PostGIS extension for a given database, I got a message like this:

NOTICE:  type "histogram2d" is not yet defined
DETAIL:  Creating a shell type definition.

And I got a similar message while running the enabler script to add wktraster support to my spatial database. But I found the solution here: It’s a hen-an-egg problem. Only a warning, not an error. My second problem was with PostGIS testing. I had to install cunit, but as I installed PostGIS before, I had to execute PostGIS ./configure again, and then do the make check. Everything worked fine. With the enviroment ready, It was the time to read again a lot of documentation. I read:

Then, I had a look at the code of some drivers, and I stopped at the PNG driver. Maybe it could be a starting point… For next week, I plan to start coding the skel of my own GDAL driver. A dummy driver, at first.  And I’d like to have a sandbox svn access. This issue is being discussed here and here —– There was a little confusion with the version number.