Skip to content

GSoC 09 Weekly Report #5: 19/06 – 26/06

June 27, 2009

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 (amazon.com)
  2. Beginning Linux programming (amazon.com)

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

—–
1: http://www.gnu.org/software/make/manual
2: http://www.gnu.org/software/make/manual/html_node/Text-Functions.html#Text-Functions
3: http://www.gnu.org/software/libtool/manual/
4: http://www.gnu.org/software/make/manual/html_node/Foreach-Function.html#Foreach-Function

Advertisements
2 Comments leave one →
  1. April 4, 2010 12:41 am

    Awsome article. Bookmarked for future referrence

  2. May 1, 2010 12:39 pm

    Thanks a lot! Still working on GDAL driver and WKT Raster extension

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: