Sunday, December 16, 2007
New Car for the New Year
Saturday, December 15, 2007
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.
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.
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 9, 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.
Thursday, December 6, 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.
Sunday, December 2, 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.
Subscribe to:
Posts (Atom)
