Tag: Qgis

RasterCalc: from Python to C++

15.10.2010 17:41 ·  GIS  ·  qgis, plugins, rastercalc

Yesterday I found out that my plugin — RasterCalc — was only announced on the QGIS mailing lists. I didn’t post anything on the forum or here. I don’t know how I could have forgotten. Although I have to admit that there was a lot of work going on at the time: RasterCalc itself, an experimental branch of GDAL Tools, Photo2Shape and many other things. QGIS 1.4 was released in January… I know it’s a weak excuse, especially considering that other plugins were announced all over the place, but I don’t have any others.

So… RasterCalc is a user-friendly and functional raster calculator written in Python. It was announced on the mailing lists on 16 January 2010.

RasterCalc window
RasterCalc window

RasterCalc was inspired by Barry Rowlingson’s RasterLang plugin. The main difference is the user-friendly interface and the familiar expression syntax (do you like LISP as much as Barry?). I have also added some additional features like saving and loading expressions, “templates” of formulas and extended the set of available functions and operators.

Weeks and months went by (I almost wrote “years”), nothing seemed to indicate any changes… And then, out of the blue, Marco Hugentobler and Tim Sutton decided to make RasterCalc part of the QGIS analysis library. This will allow its features to be used by other plugins, and remove the dependency on NumPy, pyparsing and other Python modules.

Marco has already published a first version of the patch. Some features are missing compared to the original plugin:

At the same time, new features have been added:

QGIS Raster Calculator
QGIS Raster Calculator

You can try out the new functionality by applying the patch and building QGIS from source. The calculator will appear in the “Layer → Raster calculator” menu.

The patch is still under development and some things may not work. The authors invite everyone to try it and report any bugs (if possible, attach a test dataset and steps to reproduce the issue).

QGIS User Guide in Russian

15.10.2010 15:48 ·  GIS  ·  qgis

Yay! The collaborative project to translate the QGIS 1.5 User Guide into Russian is finished. It took 1 month and 18 days, and 15 people participated.

During the translation process, many typos and inaccuracies were found, which, in the best tradition of open source, were corrected not only in the translated version but also in the original manual. Thanks to the perseverance of the project members, several major problems in the English version, such as the lack of a subject index and bibliography, have been fixed.

The translated user manual (PDF format, ~10 Mb) is now available on the QGIS website.

QGIS 1.5 User Guide translation

25.08.2010 16:37 ·  GIS  ·  qgis

A collaborative project to translate the QGIS 1.5 User Guide into Russian is announced. I will lead and coordinate the project. Please share information and get involved, and don’t hesitate to contact me if you have any questions.

QGIS mapserver

20.08.2010 15:17 ·  GIS  ·  qgis

Marco Hugentobler wants to merge his project, QGIS mapserver, into the QGIS source code.

QGIS mapserver is an open source WMS server that runs on Linux, Windows and Mac OS X (other Unix-like systems should also be supported, but have not been tested). The server is a FastCGI application written in C++. It uses QGIS libraries for rendering and GIS operations.

Among the main features:

QGIS 1.5 "Tethys"

06.08.2010 10:30 ·  Notes, GIS  ·  qgis, release

I returned to Zaporizhzhia yesterday, sunburned and a little refreshed. The heat in Crimea is terrible, and the proximity of the sea does not help. In Choban-Kale, at 11 o’clock in the afternoon, we had 53°C in the direct sun (they say it was almost 60°C in Simeiz), and the water temperature was ~28–29°C. However, it is no better in Zaporizhzhia.

While I was on holiday, the next version of QGIS — 1.5.0 “Tethys” — was released. The official announcement is on the QGIS blog. There are many changes: a lot of bugs have been fixed, new tools have been added, and old tools have been improved (fTools, GdalTools, annotations, new georeferencing module). The documentation is actively updated.

Table joins in QGIS

22.07.2010 14:44 ·  GIS  ·  qgis

Marco Hugentobler has implemented initial support for table joins in QGIS. If you want to try out the new functionality, you can get the source code from the new branch of the repository

svn co https://svn.osgeo.org/qgis/branches/table_join_branch table_join

and build it.

To join a table to a layer’s attribute table, you need:

As this feature is still in the early stages of development, there are some issues:

Geographic coordinates to raster (row, column) coordinates

21.07.2010 15:37 ·  GIS  ·  qgis, python, howto

I have noticed that recently many people have asked how to get image coordinates (row, column) from real world coordinates (latitude/longitude). The following code shows how to do this in the QGIS Python console:

import math # needed for floor() function
iface = qgis.utils.iface
# let's assume that raster is a current layer
layer = iface.mapCanvas().currentLayer()
# geographic coordinates
x = 75.0791666
y = 57.2541666
extent = layer.extent()
width = layer.width()
height = layer.height()
# raster resolution (pixel size)
xres = (extent.xMaximum() - extent.xMinimum()) / width
yres = (extent.yMaximum() - extent.yMinimum()) / height
# calculate raster coordinates (row and column)
col = int(math.floor((x - extent.xMinimum()) / xres))
row = int(math.floor((extent.yMaximum() - y) / yres))

Nothing complicated or fancy. The same code can be used in plugin with minimal changes.

GdalTools — QGIS plugin for raster data processing

06.06.2010 13:07 ·  GIS  ·  qgis, plugins, gdaltools

GdalTools (or Raster Tools) is a plugin for the open source GIS QGIS. The main purpose of the plugin is to simplify the use of the GDAL command line utilities by providing the user with a graphical interface for the most common operations.

Initially, the plugin was developed by Faunalia, later other developers, including myself, joined them. Robert Szczepanek created nice icons for most of the tools, and the development of some features was sponsored by Silvio Grosso.

At the time of the first announcement (September 2009), the plugin provided only two tools: gdalbuildvrt and gdal_contour. Now the number of integrated tools is approaching 20.

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.

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: