Work done

This week my work, principally, was to create a testing enviroment: I need to see what I’m doing, and debug it, if needed. So, I have wktrastertest.c for testing purpose. Basically, I check that the connection is correctly done. Of course, I’ve created the code for connecting with database, and basic methods for georeferencing: GetGeoTransform and GetProjectionRef.

Another important task was reading documentation:

  • Libtool: I knew of it, but I never used it. Great. But compilation is slower. Frank suggested me to configure gdal without libtool (–without libtool in configure script execution)
  • Makefiles: Ok, I’ve written makefiles before, but just now I realize on how powerful is make tool. After reading the code of GDAL’s GNUMakefiles and make’s documentation[1] , I feel like a real programmer J
  • PostgreSQL documentation about system catalogs: All the important information about the tables of a given PostgreSQL database is stored in tables. So, I had a look in the documentation to check which tables I needed to get info about my own tables (pg_class, pg_attribute and pg_type were enough).

Apart from the official documentation on these areas, I found these books really useful. From now, “must-have” books:

  1. Linux programming unleashed (
  2. Beginning Linux programming (

Oh, I forgot this. I saw an old friend again…

Click to enlarge

I missed him 😉

Problems encountered

First problem was a physical problem: hardware crash L. My hard disk died, and I had to buy a new one. I lost part of my work, but thanks to Subversion, I could get back the most of the code.

Anyway, during few days, I became absorbed into the GDAL-build system, and learning how powerful the UNIX build system can be. At first, I was using the GNUMakefile from PGCHIP driver, adapted for mine. Two things confounded me:

  • $(OBJ:.o=.$(OBJ_EXT))
  • O_OBJ = $(foreach file,$(OBJ),../o/$(file))

First one: substitution reference[2]. As I understood, It basically means that all my objects extensions will be replaced by the value of OBJ_EXT. I found that variable into GDALMake.opt (key file). If my system have libtool (yes, it has), this extension is .lo. So, time for reading about libtool[3]

Second one: foreach function[4]. O_OBJ will have the value: ../o/firstobject.o ../o/secondobject.o, etc

Now, as I said, I really know the power of UNIX build system.

Another problem was to find my own way of testing code. Tamas, Mateusz and Frank gave me some useful advices. I think I can apply most of them to improve my work-cycle.

The last problem was some doubts about setting or not sequential scan at database, and how useful can be know if the table with the raster column has an index or not. I’m reading about these issues.

Planned work for next week

Next week I’ll try to finish the code from WKTRasterDataset’s Open method. Anyway, I’ll start coding the WKTRasterRasterBand class