Almost a year has passed since the release of QGIS 1.7.0 “Wrocław”. It was supposed to be the last release of the 1.x branch, but time has taken its toll. The developers simply do not have enough resources to maintain several branches simultaneously, so it was decided to abandon the division into “stable” and “development” branches. All future releases will be based on the master branch. The result of these revised plans is the release of QGIS 1.8.0 “Lisboa” today.
This release contains many bug fixes and a significant number of new features. In addition, QGIS 1.8.0 has some minor API changes that affect the print composer. If you are using this part of the API in your plugin and are experiencing problems, the developers will be happy to help you adapt your code.
You can find a detailed description of the new features in the official announcement. I will only mention the most interesting ones:
QGIS Browser is both a standalone application and a dockable panel within QGIS. It simplifies navigation through the file system and connected data sources (PostGIS, WMS, WFS…), allows you to view metadata and preview data, add layers to the map using drag and drop
DB Manager is a new database management plugin. It supports PostgreSQL/PostGIS and SQLite/SpatiaLite, support for other databases can easily be added if needed. The plugin allows you to view tables (including those containing spatial information), add tables to a map or import layers from other data sources into the database, run queries, and display the results as layers
Heatmap plugin — a new core plugin for creating raster heat maps from point vector data
the functionality of the Terrain Analysis plugin has been updated and extended: in addition to calculating slope, exposure, and roughness index, the ability to create shaded and colour relief maps has been added
interface customisation tool — a dialogue that allows you to hide different parts of the QGIS interface (panels, buttons, widgets…)
reorganisation of plugins — new menus “Vector”, “Raster”, “Internet”, “Database” have been added. All core plugins and some third-party plugins have been updated and now create their own menus in the corresponding top-level menus
MSSQL Spatial support — added a new data provider to connect to Microsoft SQL Server spatial tables
support for compressed datasets — transparent opening of raster and vector data from zip/gzip archives
two new tools in the “Vector” menu: “Densify geometries” and “Create spatial index”
“Export/add geometry column” tool can perform calculations on an ellipsoid and in the layer or project CRS
Recently, there have been a lot of questions about working with CSV files in QGIS. So here is my attempt to shed some light on this complex and confusing topic. Be prepared for a longread.
Statist. My first plugin for QGIS. That was a long time ago: 2009, QGIS 1.0.0, start of discussions about including fTools in the core (yes, fTools was a regular plugin that had to be installed manually), only a few third-party plugins, and almost no instructions on how to write Python plugins… And I was younger and didn’t know much (to be fair, I still have a lot to learn).
The last major update of the plugin was also in 2009: I was happy with the functionality, and there were no critical bugs. Later, as I gained knowledge and experience, I thought about refactoring several times, but it didn’t work out. And recently, something came over me, so I sat down and did it.
Users will probably not notice any difference, as there are not that many changes visible to them: only support for getting statistics on joined fields has been added. But there are many more changes under the hood:
the code to check for the presence of matplotlib has been rewritten
new signal-slot connection syntax is used
completely rewritten code for calculating statistics
unused and duplicate code was removed and classes were moved into separate files
system font is used for histogram labels
The plugin now lives in my repository, please report bugs and feature requests by mail or in the bugtracker (preferred).
I found out how to write plugins for SEXTANTE. It turns out there is nothing difficult about it, and SEXTANTE is great. It is a pleasure to write plugins for it. I started by adapting my first plugin, Statist, and now I’m thinking about porting all the other analytical plugins. And if all goes well, I will have my own toolbox with the modest name “Alex’s tools” :-).
The 7th QGIS developers meeting held in Lyon (France) has ended.
The first day was rather uneventful - the host university had problems with the electricity, and besides, almost everyone arrived in Lyon in the afternoon. The following days were more intense: presentations, discussions on various aspects of the project, and, of course, coding.
finances. If we leave out all the figures and details, the picture is as follows: costs are rising, but the balance is still positive
release model. The idea of multiple release branches has been abandoned, and all new releases will be made from the main tree. Release branches will only be used as “markers”, and to fix critical bugs (like the epic extent bug) after a release. Non-critical bugfixes will not be backported. There will be a freeze period (both for code and strings) before a release on the master branch.
migrating documentation from LaTeX to RST and setting up an online platform for translators. Actually, the migration has already started with the QGIS User Manual. The plan is to convert all project documentation to RST format
improving the testing infrastructure. New tests for different parts of the code have been added, and a testing server has been setup
Among the topics discussed were also the upcoming GSoC, integration of some 3rd-party plugins into the core (DB Manager was already integrated at the time of writing), API changes, and so on.
Victor Olaya has developed another framework for integrating various libraries and tools into QGIS. It is based on the SEXTANTE platform, which includes a toolbox, a graphical modeler and a script creator. It also provides a batch processing interface, command history, and some other features. The platform currently supports SAGA, GRASS, and R algorithms, as well as tools from the fTools and mmqgis plugins. According to the author, it is quite easy to add new algorithms and new providers.
I haven’t had a chance to test it properly yet, but it looks interesting and promising. The screenshot shows the list of tools, the GUI of the Basic Statistics tool from fTools and the result it produced.
SEXTANTE plugin in QGIS
Please note that this is still a work in progress, so regular users are better off waiting for the official release rather than using code from SVN.
Not long ago, people on the forum were looking for a way to consolidate the QGIS project and related layers into one place. As no such tool existed, the discussion quickly turned into a thread full of wishes and feature requests. A little later, I was faced with the same task. Fortunately, in my case, the project only had vector layers in Shapefile format, so I quickly developed a simple and somewhat suboptimal plugin.
Now that I have more free time, I am slowly improving the plugin. I have already implemented:
support of file-based vector datasources
support for native database providers (PostgreSQL, SpatiaLite, SQLAnywhere)
layer processing has been moved to a separate thread, and the tool no longer blocks the main QGIS window
initial support for GDAL rasters
On the TODO list:
support for all vector data providers
finalise support for raster layers
provide the user with a choice of vector data format (Shapefiles or SpatiaLite database)
Most QGIS users are probably aware of the Python Console, even if they rarely use it. It is a window (accessible from the “Plugins → Python Console” menu) where you can interactively enter commands and access QGIS API functions.
QGIS Python Console
The Console is an extremely useful tool and comes to the rescue in many scenarios, from prototyping plugins to automating repetitive actions.
Obviously, typing commands every time you need to perform some task is inconvenient, so frequently executed code is transformed into scripts, and these scripts are then run from the Console. However, if the number of actively used scripts is large enough, using the console becomes a bit inconvenient. The Script Runner plugin by Gary Sherman was developed to solve this problem. The plugin is available from the official repository, has no dependencies, and can be found in the “Plugins” menu after installation.
The plugin’s interface is simple: a toolbar with large buttons, a list of scripts on the left, and four tabs — “Info”, “Source”, “Help” and “About” — on the right.
Script Runner plugin
The “Add Script” and “Run script” buttons are self-explanatory: the first one adds a script to the list (the list is saved between sessions), the second one runs the selected script.
Clicking the “Script Info” button will populate the “Info” tab with docstrings, function and class names from the selected script, and the script code will be loaded into the “Source” tab in read-only mode.
I think the purpose of the last two buttons, “Reload Script” and “Remove Script” is clear from their names. The first reloads the script (useful for debugging or if you need to tweak the code and run the process again), and the second removes the script from the list (leaving the file on disk).
Script Runner has only one requirement for scripts: they must have an entry point. The entry point is simply a run_script function that takes only one argument, a reference to the qgis.utils.iface object. If such a function is not present in the code, the script will simply not be recognised and loaded by the plugin.
The script logic can be implemented either within the run_script function or in separate functions called from it. It is also possible to use an OOP approach. In this case, you need to create an instance of the class in run_script and call the necessary method(s).
Here is a simple example (the script creates an empty LineString memory layer):
I’ve already posted a couple of beautiful videos showing the QGIS development process (first, second) made with Gource. Here are a few more, this time made by myself.
A complete history, from the beginning of development to 25 January 2012.
Developers activity from 1 September 2011 to 26 January 2012 (805 commits were made)