Reloaded Blog

Saturday, December 22, 2007

Merry Christmas and Happy New Year

So the holiday season is finally here, but I have burnt up all my leave and my spare cash going to Kenya and buying a car. So time to sit tight and haunt people's houses for free meals which they will gladly provide in this time of the year when generosity and goodwill rule their thoughts, otherwise the ghost of Christmas will haunt them every year instead of just me. Not that I can't cook, with sites like Cooking for Engineers to help me, it is not hard. Tonight's special was Prawn Jalfrezi, with prawns you have to be careful not to overcook them or they become tough like hard boiled eggs.

I am still studying for my Australian Citizenship Test. Paul if you are so eager you can do this one here, it has answers unlike mine where I am too mean to provide answers. Only the question about which is the political party currently in power needs the answer to be revised since Kevin Andrews is no longer holding down that particular plum job. All hail the separation of power now that the Federal Court has reinstated the Haneef visa. I hope they have a question about how arms of the government tangle with each other.

Also test drove RAT TerraSAR-X Driver and INSAR capability, it was a breeze producing unwrapped phase. Just need to quantify the baseline and extension to spaceborne platform position information to allow accurate DEM generation.

Wednesday, December 19, 2007

CNES(Pere Noel) releases ORFEO Toolbox 2.0.0

Pere Noel from CNES has presented his eager Remote Sensing children with OTB 2.0.0 this Christmas. Orfeo Toolbox is part of the Orfeo Accompaniment Program for the upcoming Pleiades and Cosmo-Skymed sensor constellations. This toolbox provides an Open-Source framework for processing and exploiting SAR and Optical imagery.

From the OTB 2.0.0 Release announcement:

A major release like this one happens once a year. The OTB Development
Team has worked very hard in order to make available a robust library
with plenty of very interesting things. Thanks to Emmanuel, Thomas,
Julien, Romain and Cyrille for the good work.

Thanks also to ITK, OSSIM, GDAL, 6S, libSVM and BOOST developers for the
good software upon which OTB is built.

Be careful: with OTB-2.0 you can build powerful applications easily and
for free. You can for instance produce a pan-sharpenned, ortho-rectified
Quickbird image in a few lines of code. This can hurt sensitive people.

Other key features include:

- Radiometric calibration using the 6S radiative transfer code. - Image registration with parametric geometric transformations. - Demo applications for change detection, road extraction, visualization, etc. - All existing features of version 1.6: segmentation, classification, feature extraction, spatial reasoning, change detection, etc.

OTB tends to lean towards being monolithic at times with internal source tree copies of ITK, Boost and Ossim, but it keeps people away from having to separately download and install dependencies. The only external things to install are CMake - it makes multi-platform builds a breeze, a pre-built binary copy of GDAL from FWTools and FLTK, a simple GUI toolkit which trades speed for aesthetics. Personally I would prefer a nicer GUI Toolkit such as Qt but FLTK works just fine, and the whole approach is library oriented so it will be easy to plug-in your own GUI.

After a few false starts I built OTB with MSVC++ Express and NMake files from CMake. Here are the basic screenshots.

Basic Viewer Manager:

Diaporama (ENVI Style viewer with transitions):

Interactive Change Detection:

Sunday, December 16, 2007

New Car for the New Year

So I finally I got myself a new car. It is a very well maintained Toyota Camry, looks like an oldish Mercedes and drives very quiet, accelerates smoothly and has a lot of power. Quite a bit bigger than my last car , I hope to have this one for a bit longer. Just that it is dark colour so I will have to drive it with the lights on.

Using Sqlite with QGIS-Grass Toolbox

Now that I have slogged together a lot of database drivers for Grass and GDAL it is time to put them to good use. In this article I will demonstrate how to create a Grass vector map with attributes stored in an Sqlite embedded database. I am using my Brazil mapset since the data is cities and roads in Brazil.

First open a suitable mapset in Grass from QGIS (follow the QGIS-Grass tutorial) and connect the mapset to an sqlite database by choosing sqlite driver from the dropdown box as shown below. Edit the database location so the it is created in a directory that exists, I suggest removing the already suggested dbf folder(meant for the dbf driver) and replacing it with sqlite.db. In the future this should be auto-suggested by QGIS.
Then open a suitable Shapefile or other OGR supported vector format for import into Grass. Your screen will look something like below.
Now import this dataset into Grass using the Import Vector from OGR command as shown below. You can also use the Grass shell to ensure that your attribute table gets created in the Sqlite database. After this step your vector is ready for use in Grass and all the attributes can be manipulated using SQL in the Sqlite database to perform joins with other tables or any other operation you can dream up.
The final map with various classifications produced from the Brazil dataset after importing it into Grass is shown here.

Friday, December 14, 2007

Using MingW-Fu to link to MSVC dll's and lib's

Lately my MingW-Fu has improved vastly thanks to the attempts at building Grass, GDAL and Qgis with all the possible dependencies and drivers. Here are some lessons I have learnt :
  • Don't trust libtool - Libtool in MingW is rather hobbled and needs to be fixed for long link lines using a the sed command described here.
  • Use -no-undefined - MingW linker does not like linking to libraries with some undefined symbols, use that linker flag when compiling dependencies.
  • Create shared libraries not static ones for dependencies.
  • Learn you way around the reverse engineering tools for porting from MSVC built static and dynamic libraries, specifically reimp, pexports and dlltool. Sometimes function call definitions need to be renamed using sed or added with @4 or @32 at the end (not sure what purpose this serves), I picked it up while building MySQL libraries for linking.
  • Edit any autoconf or pkgconfig scripts to use MSYS style include and libs location(Those nasty slashes will get you otherwise).
  • Any of these tricks may fail if you have specific name mangling, assembly code and other fancy things in the MSVC libraries. I have still not managed to make a linkable version of libecwj2.dll (ErMapper - Leica ECW/JPEG2000 library), mainly because it contains some of the above features.

Wednesday, December 12, 2007

New things - Computers and Scholarships

This week is turning out to be quite good. I got a new machine, Quad-core Intel with Nvidia 8800 graphics card and double 22inch monitors. I spent a couple of days setting it up. Then today I got a reply from the University of Adelaide saying that I have been given the APA scholarship to study for a PhD in SAR over 3-years. You have a few bad months then things turn around. I am planning to buy a new car over the weekend , then I will have to zealously guard the 1 remaining demerit point I have.

The Gold Qgis release build with grass compiled with ODBC, Sqlite, MySQL and PostgreSQL. I could not get GDAL linked with the same MingW being second class citizen in the GDAL world and libtool being annoying and limited as always. The current one is available here. Hope it works for you. May be one day we will have a Platinum release.

ImageLinker , the Ossim image processing GUI is now nearly fully ported to Qt4 and builds and runs fine if you do not try to optimize too much and strip symbols.

Sunday, December 09, 2007

Releasing Qgis 0.9.1

Qgis releases seem to be coming along fine. Now even my photo is in the official developers list. What an honour !!

The windows installer is available here for testing till an official release is announced. It includes latest grass release candidate, but misses Xerces and hence GML support. Living on the edge has cost me, GDAL Xerces detection to longer picks up my Xerces and Expat. I hope this will be resolved by the time we make a full release. I will try rolling back GDAL until it works but this is the latest of the latest code based release.

Friday, December 07, 2007

Who wants to be an Australian ?

So I am finally at the stage of preparing for the Australian Citizenship Test, the resource book is quite detailed but living here and reading wikipaedia is even more instructive. There are some sample tests that allow you to practice, but require signing up. Since on sample test page they say the Minister for Immigration is looking for professional question setters, I took it up to make my own flash-card like test practice application. It is simple HTML-JavaScript-PHP with the questions in a text file and no answers, once I have built it into a decent set I am planning to add it facebook as an application so that Australians can check their Australianity.

Monday, December 03, 2007

Back in the Saddle - Qgis 0.9.1 with MSVC

I am back in Adelaide in space , but not it time. My body clock is all messed up and keeping me awake at night. At least it is some other time of the day somewhere else so I can be productive. Qgis seems to making great progress towards a full MSVC build, that may not sound so good to Open Source purists, but on Windows MSVC offers superior compile time and debug capabilities than MingW does at the moment.

Tim has put together a short-cut bundle of binary dependencies so that you do not have to build everything (but building stuff is my favourite passtime anyway). The build works fine without Python-SIP, which will be easy to add and GRASS which will be slightly messier to add.

Saturday, December 01, 2007

Adelaide via Bangkok and Sydney

Finally back in Adelaide after flying around and waiting around in airports for 3 days. I had a 12 hour stop over in Bangkok, which I spent snooping on wireless networks and recruiting for my Metal Gear on PSP using AP Scan. Some shopping ensued as well, but being cash strapped does not bode well for that activity. The security check queue got huge and amorphous, it was funny watching people gulping down bottles of mineral water to avoid having the fluids check. Someone should really drink a lot of water and take diuretics on-board.

The flight from Bangkok was a bit delayed - 20mins, that nearly made me miss my connection to Adelaide and my luggage did not make it. So I spent an anxious evening in the city waiting for it. Then I spent 30mins in the taxi queue, they have made it really hard for taxi's to get into Adelaide Airport. Eventually I managed to go to Sosta for dinner, been meaning to go to an Argentinian Restaurant for a long time. The roasts were fabulous and so much that we had to take some home.