Blog

Here I post my thoughts, QGIS tips and tricks, updates on my QGIS-related work, etc.

Working with rasters using GDAL and Python

01.04.2010 09:10 ·  GIS  ·  gdal, python, howto

GDAL is a free library for working with raster and vector data. The command line utilities included in the library are widely used to perform a variety of tasks. Thanks to the developed API, you can work with GDAL functions from many programming languages. This article is dedicated to using the GDAL API in Python and is based on the GDAL Raster API Tutorial.

Read more ››

QGIS hackfest 2010 (Pisa)

15.03.2010 15:16 ·  Notes  ·  qgis, meetings

I didn’t get an Italian visa and won’t be able to attend the QGIS hackfest — bummer!

Participating via IRC is also a bit problematic: I was not allowed to go on vacation, and there is no internet at the office. I’ll try to find an hour or two after work.

Non-cyclic keyboard layout switching

22.02.2010 16:30 ·  Notes  ·  life

I was taken with the idea of non-cyclic layout switching and configured my notebook to work this way.

What is non-cyclic keyboard layout switching? Imagine you have several keyboard layouts; for example, I have three: English, Ukrainian, and Russian. Normally, to switch between these layouts, you use a single shortcut, like Ctrl + Shift, and the layouts change one by one all around: en → uk → ru → en → uk… So, if the current layout is English and you need Russian, you would have to press the shortcut twice to get there. Another problem is that in order to switch to the desired layout, you have to remember which keyboard layout is currently active and the order in which they change. You could argue that this is no big deal, as there is a visual indicator in the system tray most of the time. But the truth is that if you often have to switch between layouts and use different layouts in different windows, it is not very convenient, although most people are used to it and do not realise it.

With non-cyclic keyboard layout switching, each layout has its own shortcut, for example, CapsLock for English, Shift + CapsLock for Ukrainian, and Ctrl + CapsLock for Russian. In this case, you only need to press the shortcut once to get the layout you want. You don’t need to worry about which layout is active or remember which layout is used in a particular window. Just press the hotkey before you start typing. Simple.

After a few days of using this setup, I agree that it is indeed much more convenient than the standard cyclic switching, where you have to press the hotkey several times to get the layout you want.

GdalTools update

03.02.2010 15:36 ·  GIS  ·  qgis, plugins, gdaltools

Today we merged the experimental branch of the GdalTools plugin into the main development branch.

GdalTools (aka Raster Tools) provides users with a simple graphical interface to perform the most common raster processing tasks. Originally the plugin was created by Faunalia (Paolo Cavallini, Giuseppe Sucameli and Lorenzo Masini), the icons for the extension were created by Robert Szczepanek. About a month ago I also joined the work (and this experimental branch is my work).

This is what we ended up with:

Contributing

02.02.2010 17:56 ·  GIS  ·  qgis, plugins, photo2shape

Yesterday my patch adding import/export of connection settings to geodatabases and WMS servers was accepted.

When the user clicks on the import/export button, the following simple window appears

Manage connections dialog
Manage connections dialog

The file to which the data will be written (or from which it will be imported) is selected at the top, and the connections from that file are displayed below. Multiple selection can be made using the Ctrl and Shift keys, also list items can be selected by dragging the mouse.

Once you have saved the file, you can transfer it to another machine and add the necessary connections in a few clicks.

I also forked Tim’s ImagesToShape plugin, rewrote it to use the EXIF.py module and added some improvements. This is how Photo2Shape was born. It is already released, but there is not much feedback yet, or rather none at all :-).

Geotagging tools

27.01.2010 17:22 ·  GIS  ·  qgis, plugins

Recently Tim Sutton published a blog post about geotagging with free software and released his QGIS plugin for it. The plugin uses the exiv2 library and requires the python-exiv2 package, which is not available on Windows/OSGeo4W. Therefore ImagesToShape is not available from the plugins repository.

As I’m interested in geotagging myself, I contacted Tim and offered to rewrite the plugin, abandoning exiv2 in favour of a pure Python module.

Approval granted, so I start work on the plugin.

QGIS 1.4 "Enceladus"

12.01.2010 10:01 ·  GIS  ·  qgis, release

QGIS 1.4 “Enceladus” has been released, the announcement can be found on the official blog. This release contains over 200 bug fixes and about 30 new features. It is notable for a new symbology system, a more advanced PAL-based feature labelling engine and other improvements.

Meanwhile, the developers are working on the trunk: it is already possible to reload Python plugins without restarting QGIS, the Python console has been practically rewritten, support for GPS devices has been added, diagrams and plots now use Qwt…

And there is another hackfest planned for the end of March in Italy, details here. I’d love to go, but I don’t know if I’ll be able to.

About RasterLang and GDAL

06.01.2010 15:15 ·  GIS  ·  gdal, python

The RasterLang QGIS plugin refused to work, complaining about a self-compiled GDAL with almost everything enabled. Investigation showed that in addition to all GDAL dependencies, the NumPy package must also be installed. Otherwise you some things will not work.

NumPy is needed to build gdal_array: a small but essential module used to represent images as arrays and then do all sorts of naughty things with them.

After installing NumPy, rebuilding and updating the GDAL package, everything worked.

2009 year in review

31.12.2009 10:02 ·  Notes  ·  year-in-review

Last post of the year. It’s a good time to look back and summarise what happened.

At the end of April, I started my more or less active participation in the GIS community, which over time has become more than just a thematic resource and community for me. I found new friends here, and now most of my activities are directly or indirectly related to it.

Changing jobs… seems like a pretty big change. But after six months, I don’t see any improvements or advantages compared to my previous job. Promises are still promises, and everything I wanted to get away from is still there.

2009 will be remembered as the last year of the “senior” group of the pop dance team “Bravo”. For the last two years, the senior group has only been getting smaller and smaller, and here we are… In September, there were only five people left from the whole collective - 4 girls and 1 guy. But a bunch of newcomers arrived without any choreographic training. Our place was taken by the “middle” group, which continues to gain momentum, winning first places and all sorts of prizes at all sorts of festivals and competitions. All thanks to our artistic director and choreographer. Well done, Ira!

My first (and hopefully not the last) trip to the QGIS developer meeting took place this year. A week of working on QGIS, new friends, discussions, and a lot of impressions. Now I know for sure that QGIS is going to conquer the world :-).

After returning from Austria, I switched to using Linux. On the desktop, Windows has moved to the last line in the bootloader menu, and on the laptop, it is not there at all. Despite the lack of a few small things, Linux is an amazingly convenient and powerful system. There is no desire to go back to Win. I keep the “other system” for testing and a few very specific programs.

Happy New Year, everyone!

Improving GdalTools

23.12.2009 16:28 ·  GIS  ·  qgis, plugins, gdaltools

I’ve already submitted some patches for fTools, now it’s time to look at GdalTools. I have already added an “Info” tool to display information about the raster, implemented internationalisation support, added several new options to the “Merge” and “Warp” tools, and now I am working on a batch mode. There are also plans to add more tools.

Hopefully I will be able to get most of the work done before the New Year, and then I will start improving Statist and developing another plugin.