Category: Notes

Automonous bugtracker

07.05.2009 16:19 ·  Notes  ·  thoughts

I’ve been working on several projects lately. Of course, from time to time bugs are found or users ask for additional features… All this should be written down somewhere, because there is a very high probability that you will forget some of the features/bugs by the time you can start working on them.

In this case, the most logical and convenient solution is a bug tracker. The problem is that all the options I’m aware of are web-based, but I don’t want to install Apache and MySQL and have them running all the time just for the sake of a seldom-used system. Also, I need to use it both at home and at work - so there is a need to synchronise tracker instances. So I started looking for an “offline autonomous bug tracker”, but I haven’t found anything yet.

But why? Is it really such an exotic option? It seems to me that this kind of software would be in high demand among developers working on small projects and those who, for whatever reason, can’t or don’t want to install a web server.

The more tools the better ;-)

02.05.2009 12:53 ·  GIS, Notes  ·  qgis, ftools

Somehow, unnoticed by myself, I have been drawn into the QGIS development process. It all started with a letter asking if I would be interested in a small project (I wrote about it a few days ago). While discussing the project details, I was also asked about the possibility of creating a generic plugin to generate a statistical summary for a vector layer field, something like what ArcMap has. I was also given a link to the forum discussion on this topic.

The point is that QGIS has no standard tools for displaying a statistical summary for a table field. Of course, there is the fTools plugin by Carson Farmer, which has the “Basic statistics” tool, but it works for the whole layer, ignoring the selected features, which is not always convenient. The task seemed interesting to me, so after the work was done, I started to look into this.

First, I studied the fTools code — it (they?) is distributed in source form, like all Python plugins. As I said, the QGIS API is quite well-designed and logical, and the Python language is quite simple and has strict formatting rules, so there were no major difficulties. In the end, using Carson’s code as a base, I wrote my own tool, and also sent Carson a patch adding the ability to get statistics not only on the whole layer, but also on selected features. I also posted a message in a forum thread and sent Oleg a plugin for testing. To be honest, I wasn’t expecting such a response and the subsequent development of events.

First of all, I received a suggestion for improving the plugin from Oleg. His request boiled down to the following: currently the plugin only works with numeric fields, but it would be nice to be able to get statistics for text fields as well (e.g. number of filled/unfilled records, average text length, etc.). I have taken that into account and started working on it.

I soon received a reply from Carson as well. It turns out that he was also thinking about adding the ability to work with selected features, but he has a lot of other projects at the moment, and the process is moving slowly. So the patch came in handy. I wrote to him about statistics on text fields and suggested adding this functionality to fTools, which was welcomed. The last sentence of Carson’s letter is the title of this post.

The post on the forum did not go unnoticed. I got approval and support from the administrator there and got even more involved in the process :-).

And you know, I love it. It is terribly gratifying to feel that you are doing something useful, to realise that your work is needed and does not go unnoticed, and to feel the support and gratitude of complete strangers. Such a contrast to the situation at work.

This is probably the answer to the question raised in the previous post. I’m not used to being idle, and since my knowledge and my experience are not in demand at work, is the only thing left for me to do is to move computers from place to place and explain for the 100th time how to print on A3 sheets? Not to develop or, even worse, gradually degrade? Well, no, there are other more interesting and useful activities! That’s where this incomprehensible urge to participate in various projects comes from!

Or maybe I’m wrong, and it’s just time to move on to the next stage of self-development. This has happened before. I remember how enthusiastically I started learning GIS Geoproject and creating templates for it. As a result, I created a collection of FAQs, wrote several articles, and unexpectedly became a moderator of the support forum. In this connection I would like to thank Evgeny Yasnikov for his help in learning Geoproject, support of my efforts and trust.

Meanwhile, work continues on the statistics plugin. Getting information on text fields (both for the whole layer and for selected features) is already working. And I have received two more feature requests:

The second request has already been fulfilled, now I’m looking into the possibility of plotting graphs with PyQt tools to close the first request. I also slightly refactored the plugin code to allow localisation and added the Ukrainian language. In parallel, I am trying to add to fTools the ability to perform spatial operations not only on the entire layer, but also on selected features.

There is a great lack of time: work and, to a lesser extent, dancing do not leave enough time for everything I would like to do. The situation is compounded by family issues — when there is time, it is not always possible to work on the computer.

About programming

02.05.2009 09:45 ·  Notes  ·  thoughts

Programming has always fascinated me. When I was a kid, I was introduced to programming, first with Basics (I wrote programs to draw snowmen, cars, and other stuff), then Pascal, and on and on it went. One thing led to another, and after Pascal I learned C. After all that, playing computer games was no fun at all. This is probably one of the reasons why, for me, a computer is first and foremost a tool and not a game console, as it was for most of my friends and classmates.

Anyway, I never became a professional programmer, although I did get a second degree in the subject. The reasons for this are a topic for another post.

However, I did not give up programming. During my work in the regional branch of the State Land Cadastre Centre, I developed a system for maintaining a cadastral plan based on ArcView 3.2. Later, I tried (unsuccessfully) several times to present my own program — an automated system for the cadastre — to my superiors. I also write some small programs from time to time, both for work and for myself. And recently I made and sent a patch to the developers of the free file manager DoubleCommander. Not a big deal, just a small improvement, but the fact that it (the patch) was approved and included in the main tree is still pleasant. Almost at the same time, I had an idea for another improvement, which I plan to implement in code in the near future.

What is happening to me is, on the one hand, joyful. It’s experience, it’s practice, it’s growth. But on the other hand… I never noticed this before. Well, I wrote a small utility to automate some tasks, then I wrote another one… But there was no stable and constant desire to dig into the sources, fix something, add new functionality, make patches, follow the tracker. Am I sick?

Waiting for QGIS 1.1

27.04.2009 09:47 ·  Notes  ·  qgis

It so happened that I had been following the development of Quantum GIS exclusively from the sidelines for quite some time. I followed the discussions on the mailing lists, had a look from time to time at the forum and the blog, but I did not download new versions and did not play with them. It wasn’t because I had lost interest or the desire to master the program, but because of the chaos at work and the lack of time. There was also no prospect of using the GIS itself or the general knowledge of the technology at work. Of course, it can be argued that “knowledge is not a burden”, “who knows what will happen tomorrow” and so on. But anyway, there was no one around to say all the right things, no one to appeal to my conscience… In the end, everything turned out the way it did.

Probably the passive observation would have continued for a long time, but on one of the freelance sites I received a message with a job offer (later it turned out that I already know the guy, but that is not important), and the work is directly related to my interests: development and GIS. One of the requirements was to use free software. After some research and discussions with the client, I decided to use QGIS and Python.

Compared to the last 0.11 version I saw, the current 1.0 is a HUGE step forward. I was particularly pleased with the topological editing, support for external pyramids for raster data, many other improvements, and a new API that is simple and logical. All this, plus the ease of interface creation, makes QGIS a very promising piece of software. By the way, version 1.1 will be released soon and will add support for SpatiaLite data sources, among other things.

Looking forward for it.

April Fool's day

01.04.2009 09:10 ·  Notes  ·  qgis

I have never been a big fan of this “holiday”. As long as it is limited to innocent jokes, it is fine. But when people start doing all kinds of bad things and claim it’s a joke…

By the way, the QGIS developers celebrated today’s April Fool’s Day in a peculiar way by announcing that QGIS will become closed source, proprietary software. Humorists.

GIS Geoproject vs competitors

02.12.2008 12:17 ·  Notes  ·  geoproject

During my work in the field of cadastre I had the opportunity to use several different programs: Invent-Grad for DOS and Windows, Delta Digitals and GIS Geoproject 5.x. Some of them I used a lot, others less. I hope that my observations will help people make a choice.

All the following is based on my own personal experience and opinion — your mileage may vary.

Read more ››

Made life easier

30.10.2008 12:20 ·  Notes  ·  work

Recently, I have often been asked to produce various reports using data from .in4 files (those who know will understand). The work has to be done for “yesterday”, while the number of files to be processed is counted in the hundreds and thousands.

I used to use GIS Geoproject 5.x to do this: import files and then use the “Semantic Registry” to create the table I needed. But the lack of a batch import of the exchange files in Geoproject makes the process a real torture: select a file, import it, transfer the information to the project, select the next file… At the same time, there is a risk of getting confused and processing the same file twice, or missing something. And there is a significant slowdown after the first hundred of imported objects. It is uncomfortable, long, and monotonous process.

Deciding to simplify and speed up this process, I started programming a few days ago. The first beta saw the light of day today and even worked as it should. The principle is simple: select files, extract the necessary information and write it into a text file with a delimiter. The resulting file opens perfectly in OOo Calc or MS Excel.

I did a small test: 2219 files (20 of them are block files) were processed in about 7 seconds. Not bad.

QGIS plugin hardships

09.09.2008 08:55 ·  Notes  ·  qgis, plugins

I have been struggling with development of the Python plugin for Quantum GIS for quite some time now… I’m adding new features to a polygon layer, but after addition they are not visible on a map and not listed in the layer’s attribute table. However, if I remove the layer from the project and then add it again — all new features are there.

Here is the code I use

geom = QgsGeometry.fromPolygon([lstCoords])
ft = QgsFeature()
ft.setGeometry(geom)
ft.addAttribute(0, QVariant("atribute 1"))
self.iface.getMapCanvas().setCurrentLayer(vLayer)
vLayer.startEditing()
if vLayer.addFeature(ft, True):
    vLayer.commitChanges()
self.iface.getMapCanvas().refresh()

What is the problem? Am I doing something wrong?…