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.
I’m gradually moving from a desktop to a laptop, and spending more and more time on Linux.
By and large, the transition to Linux is almost complete. There are still a few projects that were originally developed for Win (they are very specific tools), some of which I plan to port and those that cannot be ported at all — will run in VirtualBox.
From time to time, I find myself missing some programs and tools that I am used to as a user of another system. But this is more due to ignorance.
P.S.: vim, of course, is very powerful, but to get used to it… its tutorial is very short and covers only a few topics.
An idiot’s dream :-). Finally it came true — I got a laptop.
Actually, I’ve been thinking about getting a laptop for a long time, but the fact that I have a desktop computer at my disposal has stopped me. There was no real need for a laptop. Cold calculation and expediency have always prevailed over childish “I want it!” impulses. But now the situation has changed in favour of this purchase. I’m going to the QGIS hackfest, and there will probably be more travelling after that.
I opted for a Lenovo ThinkPad SL500. It is not the most powerful machine at the moment, but it was not bought for games. As one article said, “The best laptop is YOUR laptop”, and mine suits my needs quite well :-). The only thing that is a bit annoying is the glossy top lid. It seems to be a problem for all manufacturers: everywhere I’ve been — all laptops are glossy, and many not only on the outside, but also on the inside. So I didn’t have much of a choice here. The newer SL510 is matte (thanks to Patrick, they came to their senses!), but it is impossible to get it now, especially in our province.
For those who are interested, here are the brief specifications: 15.4" WXGA TFT display, Celeron DualCore T3000 1.8GHz/800MHz, GL40 Express chip, integrated video GMA 4500M, RAM 2048 Mb DDR2 667 MHz (PC2-5300), HDD 250 Gb, DVD-RW, modem, Wi-Fi, Bluetooth, LAN 1 Gb/s, 7-in-1 card reader, webcam 2 Mpx, 4 USB ports, there are also headphone and microphone outputs, HDMI, FireWire and VGA. A detailed review can be found on notebookcheck.net, where the same model is described, but with a slightly different configuration.
I have already installed DeepStyle 3.1, updated some packages and am now setting up a build environment for QGIS. I also need to read a lot of mans and do some fine-tuning (suspend, power management, CPU frequencies, etc.). But all this will probably be done after the hackfest, as there is not much time left.
I haven’t written anything for a month, as I just haven’t had enough time, and internet access has been quite limited at times. The most important news is that I’m going to the QGIS Hackfest in Vienna. Actually, the discussion about attending the hackfest started more than 2 months ago at the end of August, but I deliberately did not write anything because there were a lot of problems and ambiguities, especially the question of the visa. It was only this week that everything finally became clear.
The most difficult part was getting a visa from the Austrian embassy. The first thing you need to do is call the embassy or visit them in person to get the list of documents required and make an appointment. The last option is more suitable for Kyiv residents; for the rest, it is better to make a call. Remember that there is a charge for the call (€12) and that you can only pay by VISA or MasterCard, so keep your card details around.
The list of documents is not very long, but for all the documents you need a copy with a translation into German, otherwise, they will not be accepted. I have collected the following documents:
a foreign passport
copies of all pages of the national passport that contain any information
a copy of the individual tax number
a certificate from your place of work stating your average monthly salary and that you will keep your salary and job for the duration of the trip (if, like me, you have recently changed jobs and have not worked for 3 months, please also bring a copy of your employment record)
a bank account statement with information on account balance and movements of funds for the last 3 months
2 photos 3.5×4.5
filled visa application form
documents confirming that I won’t be living on the street or at the train station :-) (the statement from the online booking should work)
insurance with coverage of €30,000
The documents should be submitted one month before the planned date of departure. Of course, you can submit them earlier, but they will only be processed one month before anyway. I went to Kiev, stood in line and handed in the documents. Last week I received a call for an interview and went to Kyiv again…
It turns out that I am a suspicious person for the embassy. I got my passport back in April 2008, but it was “clean” until now (well, I haven’t had much luck travelling). So “clean” passport — one. I’m travelling alone — two. Only for 5 days — three. Four: travelling alone, all alone and and not on a sightseeing tour from some agency. Going to the capital — five (Why? For what? He’s probably a terrorist). I talked to the officer for about 15-20 minutes, and here the letter with the invitation to the hackfest, or rather to the “developers’ meeting” (if it had said hackfest — I would certainly have left without a visa), which I had asked the organisers for in advance, came in very handy. Then I waited almost 4 hours for an answer, but it was worth it — they gave me a visa in the end. For exactly 5 days. Now I am packing my bags.
P.S.: You can read about the upcoming hackfest in Vienna on the wiki. There is also a blog post with a report on the previous one, which took place in Hannover this spring, and an interview with the participants. If I get the chance, I will try to post updates directly from the scene or share my impressions when I get back. And this post can be seen as a teaser :-).
I wanted to build QGIS on Windows using MSYS + MinGW. So, I gathered all the necessary programs and libs, updated the QGIS code from SVN and, armed with the “Coding and compilation guide”, set to work. It took my Sempron almost two evenings to compile the dependencies and QGIS itself. It went well at first, but when I got to avce00, I stuck. That thing would not compile at all, throwing warnings and errors at almost every line. I gave up and grabbed the binaries from OSGeo4W. That did the trick.
And this is the moment. It’s compiled. I run it and… and nothing. QGIS crashes at the beginning of loading. I run it from the console — it crashes again, leaving an “Access violation” message in the terminal. So here I am scratching my head and trying to figure out who to blame: avce00, my two left hands or spots on the sun. There are many reasons for this behaviour. Even developers say that building with MSYS and MinGW is quite a complex process.
I decided to postpone it for now, and in the meantime, I will try to build QGIS with VisualStudio Express. I need it for work.
A bit more about Cyrillic and other non-ASCII characters in matplotlib. I decided to create a more comprehensive example to show how to output Cyrillic (or any other non-ASCII) characters in different parts of the plot. Actually, there is nothing complex here; you just need to find the time and read the manual, which is quite good, by the way. But as not everyone likes to read manuals… Anyway, here is the code:
#!/usr/bin/env python# -*- coding: utf-8 -*-from pylab import*import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
plt.rcParams["text.usetex"] =Falsefp = fm.FontProperties(fname="/home/alex/devel/mpl_cyr/CharisSILR.ttf")
plt.text(0.5, 0.5, u"довільний текст", fontproperties=fp)
# create some data to use for the plotx = arange(0.0, 3.0, 0.01)
y1 = sin(2* pi * x)
y2 = cos(2* pi * x)
# the main axes is subplot(111) by defaultplot(x, y1, label=u"Синусоїда")
plot(x, y2, label=u"Косинусоїда")
xlabel(u"Підпис вісі X", fontproperties=fp)
ylabel(u"Підпис вісі Y", fontproperties=fp)
title(u"Назва графіка", fontproperties=fp)
legend(prop=fp)
show()
There is a wonderful Python library — matplotlib. It is a plotting library that supports a wide range of plot types and is designed to emulate MATLAB commands and behaviour. The library is easy to learn; to draw a simple plot, you literally need two commands. I have used this library in my Statist plugin for QGIS and in another GIS project. To make installation of matplotlib more convenient for inexperienced users, I recently packaged it for OSGeo4W.
Sometimes, I needed to display non-ASCII (namely Cyrillic) characters on matplotlib plots. And there was a problem: such text was drawn as empty squares. Reading manuals, googling, and asking on the mailing list led to two solutions that I would like to share with you.
Method 1: the almighty TeX
matplotlib can use LaTeX to display both plain text and mathematical symbols. Moreover, a limited subset of TeX and the corresponding parser, fonts, and renderer are built into the library, so for this subset, you do not even need to have a full TeX installation. Unfortunately, this TeX subset only contains mathematical characters and letters of the Greek alphabet. In all other cases, an external LaTeX installation is required. To use LaTeX for text rendering, we should set the option
text.usetex: True
in the rc-file. This can be done either globally, by editing the rc-file once, or as needed at runtime. Below is an example of run-time initialisation:
Now we can output Cyrillic (or any other non-ASCII characters)
xlabel(u"Вісь Х: довжина, см")
The big disadvantage of this method is that the user needs to have LaTeX installed.
Method 2: unicode + fonts
matplotlib uses its own font rendering engine with full Unicode support. Therefore, we can explicitly specify a font that contains the required character sets and render the text using that font. Here is a small example:
# -*- coding: utf-8 -*-import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
plt.rcParams["text.usetex"] =Falsefp = fm.FontProperties(fname="/home/alex/.fonts/academy.ttf")
plt.text(0.5, 0.5, u"кириличний текст", fontproperties=fp)
plt.show()
There is also a disadvantage — the required font may not be available on the target system or may be in a different directory, so the font has to be stored in the same directory as your program. But in my opinion, this is much better than having LaTeX as a dependency.
It’s been a week since I went on “last year’s” holiday. Yes, I managed to get those unused 19 days. But that doesn’t stop my bosses from pestering me with phone calls and even dragging me into the office a few times. But all in all, it is very good.
I have more free time, which I spend not only on holidays but also on interesting and necessary things like plugins for QGIS. I’ve already received some feedback on Statist, and I’m improving it. Also, I have an idea for another plugin, but I don’t know if it will be implemented yet.
I am also involved in a GIS project, or rather, its continuation. While working on it, I came across a nasty bug in the SpatiaLite provider in QGIS. At least, it seems to me that it is a bug. This has caused some difficulties, and I have to look for workarounds…
By the way, a few days ago, Alessandro Furieri (SpatiaLite author) announced the release of SpatiaLite 2.3.1 and released two new projects:
RasterLite — an API for working with rasters in SQLite, and supporting almost all functions needed by any GIS
SpatiaLite-GIS — a simple GIS system built on top of SpatiaLite. This GIS is very similar to both spatialite-gui and a very stripped-down version of QGIS. Of course, he can do what he wants, but IMHO, it would be much better if more attention was paid to supporting SpatiaLite integration in QGIS
In my opinion, SQLite-based spatial databases are a real alternative to shapefiles. Although shapefiles are the de-facto standard in GIS today, they are already outdated and do not meet the ever-increasing requirements.
It’s hot, although even during the day the temp doesn’t rise above +25°C. The heat is particularly noticeable when dancing: our classroom is very limited when it comes to ventilation and opening windows, so everyone is sweating within 5-10 minutes of starting the warm-up. On the other hand, it is the perfect time for stretching — muscles warm up quickly and lose heat more slowly. Ira is making the most of this: she has decided to devote the last month of this year’s course to stretching alone.
Earlier I wrote about work on translating the OSGeo4W network installer into Ukrainian. It’s time to report. Translations are done, new resource files are committed to SVN, installers are built, uploaded to the server and available for download. Download links can be found on the OSGeo4W home page.