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 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:
there is no support for “templates” of formulas (in RasterCalc there are two: “Difference” and “NDVI”)
the result can only be saved with Float32 data type
saving and loading of expressions is not supported
At the same time, new features have been added:
it is possible to specify the desired resolution and extent of the result. This allows rasters with different resolutions to be used in one expression. If necessary, the rasters are automatically resampled to the output resolution
result can be saved in various formats, not only GeoTiff
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).
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.
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:
the plugin is localised. In addition to the default English interface, there are Ukrainian and Russian translations (though not yet complete).
new tools: “Information”, “Build Overviews”, “Assign Projection”, “Clipper”
batch mode for tools “Build Overviews”, “Translate” and “Reproject”
new parameters “Use intersected extent” and “Layer stack” have been added to the “Merge” tool
it is now possible to change the output image size when reprojecting raster
almost all tools now have “smart” selectors - combined fields that can be used to select either the map layer or the file(s) on the disc.
results can be saved not only in GeoTiff, but also in any other format supported by the corresponding tool.
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
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 :-).
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.
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.
I continue to work on the Statist plugin. It’s been a while since I updated the public repository — I’ve been working with my local copy. But today I uploaded a pretty big update.
Among the most notable changes:
ability to export frequency distribution histogram in PNG, PS, EPS, SVG and PDF formats
added toolbar with interactive plot navigation tools such as zoom and pan
the frequency distribution can be displayed as a histogram or a line graph.
ability to manually set range for both axes
improved and more polished UI
extended number of statistical values calculated by the plugin
fixed the issue with the broken plot resizing when changing the plugin window size.
There is only one major bug left (there are probably others, but they have not shown up yet) — in some cases, the histogram is displayed in a rather strange, I would say suboptimal, way. I have some ideas about how to fix this and will have to test them.
Enjoy the plugin. If you have any problems and/or feature requests, do not hesitate to email the author :-).
It is used to obtain statistical information on the specified field of the vector layer attribute table. Both numeric (integer, real, and date) and text (string) fields are supported. The plugin can work on the whole attribute table as well as on selected features. In addition to displaying basic statistical values, Statist also displays a frequency distribution histogram of the field values.
Statist plugin dialog
To use Statist, it is necessary to have matplotlib installed (it can be installed via OSGeo4W or downloaded from the project page, as it is used to display the frequency distribution histogram.
The plugin is available from my QGIS plugins repository. Comments, feature requests, and bug reports are welcome. It is best to post them in the bugtracker, but email is fine too.
If someone does not need a frequency distribution histogram and unnecessary dependencies, they can use the “Basic Statistics” tool from fTools (now included in core). After my patch, it has the same functionality as Statist except for the frequency distribution histogram.
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()