Working on QField I had the necessity of passing values from the QtActivity.java to the Qt cpp world, here how I did it using an Intent that is sent to the QtActivity (the one you should not edit that comes with…
Working on QField I had the necessity of passing values from the QtActivity.java to the Qt cpp world, here how I did it using an Intent that is sent to the QtActivity (the one you should not edit that comes with…
Following on from part 1 in which I introduced how variables can be used in map composers, I’d like to now explore how using variables can make it easier to manage your QGIS projects. As a quick refresher, variables are a new feature in QGIS 2.12 which allow you to create preset values for use anywhere you can use an expression in QGIS.
Let’s imagine a typical map project. You load up QGIS, throw a bunch of layers on your map, and then get stuck into styling and labelling them ‘just right’. Over time the project gets more and more complex, with a stack of layers all styled using different rendering and labelling rules. You keep tweaking settings until you’re almost happy with the result, but eventually realise that you made the wrong choice of font for the labelling and now need to go through all your layers and labelling rules and update each in turn to the new typeface. Ouch.
Variables to the rescue! As you may recall from part 1, you can reuse variables anywhere in QGIS where you can enter an expression. This includes using them for data defined overrides in symbology and labelling. So, lets imagine that way back at the beginning of our project we created a project level variable called @main_label_font:
Now, we can re-use that variable in a data defined override for the label font setting. In fact, QGIS makes this even easier for you by showing a “variables” sub-menu allowing easy access to all the currently defined variables accessible to the layer:
When we hit Apply all our labels will be updated to use the font face defined by the @main_label_font variable, so in this case ‘Courier New’:
In a similar way we can bind all the other layer’s label fonts to the same variable, so @main_label_font will be reused by all the layers in the project. Then, when we later realise that Courier New was a horrible choice for labelling the map, it’s just a matter of opening up the Project Properties dialog and updating the value of the @main_label_font variable:
And now when we hit Apply the font for all our labelled layers will be updated all at once:
It’s not only a huge time saver, it also makes changes like this easier because you can try out different font faces by updating the variable and hitting apply and seeing the effect that the changes have all at once. Updating multiple layers manually tends to have the consequence that you forget what the map looked like before you started making the change, making direct comparisons harder.
Of course, you could have multiple variables for other fonts used by your project too, eg @secondary_label_font and @highlighted_feature_font. Plus, this approach isn’t limited to just setting the label font. You could utilise project level variables for consolidating font sizes, symbol line thickness, marker rotation, in fact, ANYTHING that has one of those handy little data defined override buttons next to it:
One last thing before I wrap up part 2 of this series. The same underlying changes which introduced variables to QGIS also allows us to begin introducing a whole stack of new, useful functions to the expression engine. One of these which also helps with project management is the new project_color function. Just like how we can use project level variables throughout a project, project_color lets you reuse a color throughout your project. First, you need to create a named colour in the Default Styles group under the Project Properties dialog:
Then, you can set a data defined override for a symbol or label colour to the expression “project_color(‘red alert!’)“:
When you go back and change the corresponding colour in the Project Properties dialog, every symbol bound to this colour will also be updated!
So, there you have it. With a little bit of forward planning and by taking advantage of the power of expression variables in QGIS 2.12 you can help make your mapping projects much easier to manage and update!
That’s all for now, but we’re still only just getting started with variables. Part 3, coming soon!.. (Update: Part 3 is available now)
It’s been quite some time since I last had a chance to blog and a lot has happened since then. Not least of which is that QGIS 2.12 has now been released with a ton of new features that I’ve neglected to write about! To try and get things moving along here again I’m planning on writing a short series exploring how variables work in QGIS 2.12 and the exciting possibilities they unlock. First, let’s look into how variables can be used with QGIS map composer…
So, let’s get started! A new concept introduced in QGIS 2.12 is the ability to set custom variables for use in QGIS’ expression engine. The easiest way to do this is through the “Project Properties” dialog, under the “Variables” section:
You’ll see in the screenshot above that a blank project includes a number of read-only preset variables, such as @project_path and @project_title. (All variables in QGIS are prefixed with an @ character to differentiate them from fields or functions). You can add your own variables to this list by clicking the + button, as shown below:
Here I’ve added some new variables, @project_version and @author. Now, any of these variables can be used anywhere that you can use expressions in QGIS, including the field calculator, data defined symbology, labelling, map composer text, etc. So, you could make a map composer template with a label that includes the @author, @project_version and @project_path variables:
Sure, you *could* also manually enter all these details directly into the label for the same result. But what happens when you have multiple composers in your project, and need to update the version number in all of them? Or you move your project to a new folder and need to make sure the path is updated accordingly? Manually updating multiple composers is a pain – make QGIS do the work for you and instead use variables! This would especially be helpful if you’re saving map composer templates for use across multiple projects or users. Using variables will ensure that the template is automatically updated with the right details for the current project.
Another neat thing about QGIS variables is that they can be inherited and overridden, just like CSS rules. Opening the options dialog will also show a Variables group for setting “Global” variables. These variables are always available for your QGIS installation, regardless of what project you’re working on at the time. If your workplace tends to reorganise a lot and constantly shuffle your department around, you could add a global variable for @work_department, so that changing the global variable value in one place will automatically filter through to any existing and future projects you have.
And like I mentioned earlier, these variables are inherited through various “contexts” within QGIS. If I reopen the Project Properties dialog, you’ll see that a project has access to all the global variables plus the variables set within that specific project. In addition, by adding a variable with the same name to the Project variables the value of the Global variable will be overridden:
There’s also a variable editor within each individual composer’s properties tab, so variables can also be set and overridden on a composer-by-composer basis within a project. It’s a really flexible and powerful approach which both simplifies workflows and also opens up lots of new possibilities.
Another sold-out event with a programme packed with useful, interesting and delightful talks. Fifty seven (57!) folk blew in from all over Scotland through a freezing rain but hot coffee and pastries were waiting in the Informatics Forum at the University of Edinburgh.
First up was an overview the current status of the QGIS project by Saber from Lutra Consulting. It was good for people new to QGIS and open-source to see how the project is organised and run and the direction it is taking. Pete, also from Lutra Consulting, then gave a quick summary of the bits of core functionality they have been working on including the new ruled based labelling system.
The group then split into two for 90 minute workshop sessions on cartographic labelling and advanced Atlas usage – a tough choice! Chris, from Ordnance Survey, presented a detailed how-to on the new ruled based labelling tools using some OS open data, interspersed with some slides on guidelines to good cartographic practices and labelling tips. The slides and material for this workshop are available here: https://dl.dropboxusercontent.com/u/185489368/QGIS-Scotland2015.pdf
Heikki, from thinkWhere, lead us through the process of using Atlas in Print Composer to automate map production for a series of maps containing a main context map and an inset overview map. Nothing better than doing something once and then being able to repeat it at the click of a button! The slides and material for this workshop are available here: https://github.com/HeikkiVesanto/Scottish_QGIS_User_Workshop
A break for lunch and a good hour of catching up with users from across all sectors – local government, central government, academia, forestry, planning consultancies, developers, student life and education. QGIS is popular and is obviously a flexible tool that meets many demands.
After lunch, Neil, from thinkWhere, organised a quick-fire “quirky QGIS quiz” with random questions from all aspects of FOSS4G demanding quick thinking for true/false answers. At least half the audience grabbed prizes courtesy of thinkWhere and Ordnance Survey.
What followed was a series of lightning talks on different aspects of using QGIS. Amy, from Cawdor Forestry, gave a brief overview of the plugins available in the QGIS plugin repository and highlighted some of her personal favourites. Paul, from Scottish Water, showcased some of the complex workflows created using SAGA, QGIS and the Processing Toolbox to model hydrological process. Ross, from Inverclyde Council, demonstrated the use of the QGIS Road Graph plugin to generate walking routes to school across a custom road and path network. Seb, from West Dunbartonshire Council, showed us how QGIS had put them in a happy place and showed how a “hearts and minds” campaign championing QGIS had changed the way they worked. Steve, fae Embra, gave some information on how to give back to the QGIS project through submitting Processing scripts and plugins to the repository. Don’t reinvent the wheel! Ross, from Angus Council, gave a quick demonstration of setting up a local plugin repository that could be used to share custom plugins or control access to plugins in an internet-less environment.
By this time, tea and cake was required and it gave everyone an opportunity to mix and ask questions of the speakers.
The last session was as series of longer talks started by Gemma, from Ordnance Survey, explaining how open-source software is used extensively at Ordnance Survey to underpin a lot of the cartographic processes and workflows. They use QGIS 2.8 LTR for stability and consistency across the business and a selection of plugins from both OS developers and the community. QGIS is used to generate all the cartographic styles sheets for the OS vector products: https://github.com/OrdnanceSurvey/OS-VectorMap-District-stylesheets
Tom, from EDINA, explained the processing of creating and delivering a QGIS training course to University staff and students. The first class sold out in next to no time and there is demand for more. Makes sense really, doesn’t it?
Steve, from GeoGeo, wrapped up the day with the kind of mapping we’d all like to be doing – high resolution elevation models, time series analysis of shadows, viewsheds across the Edinburgh skyline and analysis of rooftops for potential solar panels with sub 1m resolution LiDAR datasets. He uses a mix of QGIS, SAGA, Blender and other FOSS to inspiring effect. Check his Flickr stream: https://www.flickr.com/photos/stevefaeembra/
The day finished with Pete (Lutra Consulting) releasing into the open a new Search plugin for QGIS called Discovery (http://www.lutraconsulting.co.uk/products/discovery/) based on the PostGIS Search plugin from Tim Martin (Ordnance Survey). A very useful addition to any QGIS installation.
Links to slides will be coming shortly.
It’s been a while since my last blog post mostly because I’ve been busy with some more long form writing. Most notably, I’ve been writing a paper on the QGIS Projcessing framework in the open access ISPRS International Journal of Geo-Information together with Victor Olaya and I’m still in the process of writing a new book titled “QGIS Map Design” together with Gretchen Peterson which is scheduled for early 2016.
Today’s post has been on my todo list for a while now. It’s inspired by a talk at a recent cartography conference I attended:
Anita Graser (@underdarkGIS) November 11, 2015
(For a summary of the whole event, check the storify I compiled.)
The idea of this slide and several more was to show all the attention to detail which goes into designing a good road map. One aspect seemed particularly interesting to me since I had never considered it before: what do we communicate by our choice of line caps? The speaker argued that we need different caps for different situations, such as closed square caps at the end of a road and open flat caps when a road turns into a narrower path.
I’ve been playing with this idea to see how to reproduce the effect in QGIS …
Anita Graser (@underdarkGIS) November 14, 2015
So first of all, I created a small test dataset with different types of road classes. The dataset is pretty simple but the key to recreating the style is in the attributes for the road’s end node degree values (degree_fro and degree_to), the link’s road class as well as the class of the adjacent roads (class_to and class_from). The degree value simply states how many lines connect to a certain network node. So a dead end as a degree of 1, a t-shaped intersection has a degree of 3, and so on. The adjacent class columns are only filled if the a neighbor is of class minor since I don’t have a use for any other values in this example. Filling the degree and adjacent class columns is something that certainly could be automated but I haven’t looked into that yet.
The layer is then styled using rules. There is one rule for each road class value. Rendering order is used to ensure that bridges are drawn on top of all other lines.
Now for the juicy part: the caps are defined using a data-defined expression. The goal of the expression is to detect where a road turns into a narrow path and use a flat cap there. In all other cases, square cap should be used.
Like some of you noted on Twitter after I posted the first preview, there is one issue and that is that we can only set one cap style per line and it will affect both ends of the line in the same way. In practice though, I’m not sure this will actually cause any issues in the majority of cases.
I wonder if it would be possible to automate this style in a way such that it doesn’t require any precomputed attributes but instead uses some custom functions in the data-defined expressions which determine the correct style on the fly. Let me know if you try it!
This is a core-enhancement QGIS plugin that makes the implementation of complex dynamic filters in QGIS attribute forms an easy task. For example, this widget can be used to implement drill-down forms, where the values available in one field depend on the values of other fields.
The new “Form Value Relation” widget is essentially a clone of the core “Value Relation” widget with some important differences:
When the widget is created:
- the whole unfiltered features of the related layer are loaded and cached
- the form values of all the attributes are added to the context (see below)
- the filtering against the expression happens every time the widget is refreshed
- a signal is bound to the form changes and if the changed field is present in
the filter expression, the features are filtered against the expression and
the widget is refreshed
Using form values in the expression
A new expression function is available (in the “Custom” section):
This function returns the current value of a field in the editor form.
- This function can only be used inside forms and it’s particularly useful when used together with the custom widget `Form Value Relation`
- If the field does not exists the function returns an empty string.
Download the example project.
This is the new widget in action: changing the field FK_PROV, the ISTAT values are filtered according to the filter expression.
What’s new in a nutshell
The new GRASS GIS 7.0.2 release provides 190 stability fixes and manual improvements.
About GRASS GIS 7: Its graphical user interface supports the user to make complex GIS operations as simple as possible. The updated Python interface to the C library permits users to create new GRASS GIS-Python modules in a simple way while yet obtaining powerful and fast modules. Furthermore, the libraries were significantly improved for speed and efficiency, along with support for huge files. A lot of effort has been invested to standardize parameter and flag names. Finally, GRASS GIS 7 comes with a series of new modules to analyse raster and vector data, along with a full temporal framework. For a detailed overview, see the list of new features. As a stable release series, 7.0.x enjoys long-term support.
Source code download:
- To get the GRASS GIS 7.0.2 source code directly from SVN, see here.
- winGRASS 7.0.2 standalone installer
- winGRASS 7.0.2 in OSGeo4W installer
- … further binary packages for other Linux distributions and Mac OSX will follow shortly.
See also our detailed announcement:
About GRASS GIS
The Geographic Resources Analysis Support System (http://grass.osgeo.org/), commonly referred to as GRASS GIS, is an Open Source Geographic Information System providing powerful raster, vector and geospatial processing capabilities in a single integrated software suite. GRASS GIS includes tools for spatial modeling, visualization of raster and vector data, management and analysis of geospatial data, and the processing of satellite and aerial imagery. It also provides the capability to produce sophisticated presentation graphics and hardcopy maps. GRASS GIS has been translated into about twenty languages and supports a huge array of data formats. It can be used either as a stand-alone application or as backend for other software packages such as QGIS and R geostatistics. It is distributed freely under the terms of the GNU General Public License (GPL). GRASS GIS is a founding member of the Open Source Geospatial Foundation (OSGeo).
The GRASS Development Team, November 2015
A lot of people are using QGIS Cloud as a service with ready to use QGIS webclient. It’s very easy to publish data and share maps in this way. Publishing of georeferenced images can be done with QGIS Cloud in a few steps as well. But the main problems are:
- how to upload the images into the cloud database?
- how to manage them?
- how to display the results?
QGIS and QGIS Cloud are offering all tools for this task.
Create a new spatialite layer with QGIS:
As the first step we need to create a point layer with some mandatory columns.
- Open the
New Spatialite Layerdialog with Layer -> Create Layer -> New Spatialite Layer
- Create in minimum three columns :
- name text
- filename text
- image text
- name the new layer
Create a new dialog with QtDesigner which looks like in the image below.
For adding and managing the images a customized input GUI is needed.
- add two QLineEdit Widgets and name them with the corret objectName
- add two QTextEdit Widgets and name them with the corret objectName
add a QToolButton Widget with the corret objectName
- or download the file attribute.ui
- Open the layer properties of layer
imagesand open the section fields.
- Select from “Attribute editor layout”: Provide ui-file
- To get the custom UI select the path to
attribute.uiin “Edit UI” and open the gui.
- Click OK
Create a Python init function for handling the image data.
When you add a new feature to the layer
images, the dialog opens but the tool button is not working. To get it working we need some Python code.
The idea behind that is to run some functionality to convert the binary image to text based base64 encoding. Let’s Python doing that job for us. QGIS offers the ability to define an init function when a custom dialog is opened. This offers a wide range of options.
- create a new text file and call it
- add the following Python code (or download the Python script encodeimage.py):
Import all nesseccary Modules and Classes from PyQt4 and QGIS
from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import QgsFeature, QgsMapLayerRegistry import base64
Define some global variables
filePathField = None imageField = None imagePreview = None toolButton = None fileName = None
This is the main function which will be connected with the QGIS layer dialog
def formOpen( dialog, layer, featureid ): global filePathField global imageField global imagePreview global toolButton filePathField = dialog.findChild(QLineEdit, "filename") imageField = dialog.findChild( QTextEdit, "image" ) imagePreview = dialog.findChild( QTextEdit, "imagePreview" )
Find the QToolButton Object to connect the conversion function.
toolButton = dialog.findChild( QToolButton, "toolButton" )
When the ToolButton is clicked run the method getFileName()
set the imageField Widget invisible for a nicer GUI. It is not nesseccary to see the data
imageField.setVisible(False) imagePreview.setText('<img width="300" src="data:image/jpg;base64,'+imageField.toPlainText()+'"/>')
Open FileDialog and convert the binary image to base64
def getFileName(): filePath = QFileDialog.getOpenFileName(None, 'Open Image File', '', '(Images *.jpg *.png)') if len(filePath) > 0: filePathField.setText(filePath) encodedImage = ''
Read the image file and proceed the encoding
encodedImage = base64.b64encode(open(filePath, 'rt').read())
Set the appropriate fields for storing in the QGIS layer
Set HTML img tag around the base64 image
imagePreview.setText('<img width="300" src="data:image/jpg;base64,'+encodedImage+'"/>')
If you have finished editing, save this file in the same directory where your QGIS project file is stored. As the final step to connect the layer
images with the Python module you have to define the Python init function in the layer properties of the layer images. Add
encodeimage.formOpen to the Python init function definition. The Fields definition of the layer properties of layer “images” should look like
Now you are able to add images and photos to your spatialite database table. But be careful because the main disadvantage of this approach is the size of the image. The conversion of a 5Mb image produces a huge base64 string. As the result it will be very wise to reduce the size of the images you want to add to the layer. If you like, you can add a check of image size to the Python module.
A nice tool of the QGIS map canvas is the option to add maptips to a layer. When maptips are activated images should be visible when the mouse moves over a feature of the layer
images in the map.
Create a maptip with image as content
- open the layer properties of the layer
imagesand jump to the
- tick the HTML radio button.
- add the HTML code to the Text field as you can see in the figure below:
- close the dialog with OK
- activate the maptip tool in QGIS and move over a feature of the layer
images. The ame and the image are popped up.
Share your images with QGIS Cloud
What’s about to share the pictures and the geolocation of the pictures with others over the web. For this task QGIS Cloud is the right choice. QGIS Cloud is your personal spatial data infrastructure and offers OGC Web Services and ready preconfigured Web GIS clients.
- save the project.
- open the QGIS Cloud plugin (If you don’t have the QGIS Cloud plugin installed, than install it from the official QGIS Plugin Repository)
- log in your QGIS Cloud account. (If you don’t have a QGIS Cloud account, sign up a new account).
- upload the local data to your QGIS Cloud database (if you don’t have a QGIS Cloud database, create one from the QGIS Cloud plugin).
- publish the project via QGIS Cloud plugin.
- open the map in QGIS Cloud Web Client
- activate the identify tool and move over a point with image
- here you are, it works
Our training courses are structured to give trainees step-by-step guide using the latest QGIS features. Here is an example of one our practicals for creating professional maps.
Trainees will learn how to
- Assign multiple style to a layer
- Working with presets
- Working QGIS print composer
- Generating maps using Atlas
Read on if you’d like to get a flavour of our training course practicals…
Creating professional maps with the Print Composer
QGIS' Print Composer allows users to create professional maps for printing. It supports legends, frames, logos and all the other features you’d expect to see in a print quality map.
In this example, we’ll use some of the most common features required to generate a map for printing.
We’ll first load the electricity usage data created in another tutorial, style it using a simple colour ramp, then create a new map composer complete with title and legend.
Click here to download the tutorial data. After downloading, ensure to extract the file.
Loading data in QGIS
The styling of a vector layer can be performed using a single style, or a varying style, based on the value of one or more attributes. We are going to first load the London energy usage layer prepared in an another tutorial by joining electricity usage with the LSOAs vector layer.
``` Start a new QGIS project
Add the MSOA_GL_ElecUsage.shp layer under extracted downloaded folder ```
The vector layer should now look like the figure below.
Energy consumption in London
Next, we are going to add a shapefile of London Boroughs to identify areas of high and low usage.
``` Add London_boroughs.shp from extracted downloaded folder
Open layer properties and under Style:
Set the style of the polygons to “No Brush” with a “Dash Line”. ```
Your map now should look like the figure below:
Energy consumption in London
In QGIS, you can apply multiple styles to a single layer. Using this method, we do not need to load the same layer multiple times. In this case, we need two styles for London boroughs layer:
Without labels (as created above); to be used as an overview map
With labels (next section); for the main map
We can save the current style (without label):
``` Right-click on London_boroughs layer from the layer tree and select Styles > Add
For the new style, type ‘no label’ and click OK ```
We can save the new styles (with labels) for the layer:
``` Right-click on London_boroughs layer from the layer tree and select Styles > Add
For the new style, type ‘with label’ and click OK ```
Changes in the next section (adding label) will be saved in with label style.
We’ll now add labels to each of the boroughs. The name of each borough is stored as the value of the NAME attribute.
``` Click on the London_boroughs layer in the ToC
Form the main menu, select Layer > Labelling ```
This window will allow us the set an attribute for label and also change font, size, rotation, buffer, etc.
Setting up labels on the London boroughs layer
``` Enable the Label this layer with option
Set Field with labels to NAME
Under Text section, set the font to 7 pt
Under Buffer section:
Enable Draw text buffer
Set the Size to 0.5 mm
Click OK ```
You should now be able to see a label for each borough.
London boroughs with labels
In QGIS, you can create presets for layer visibility and styles. In this example we are going to create the following presets:
Map of LSOAs with the energy usage and borough boundaries
A separate preset for the London boroughs (without labels) which will be used as an “overview” for the print composer
To create the first preset:
``` Ensure both layers are visible
Right-click on London_boroughs and select Style > with label ```
On top of the legend tree in QGIS, you can see the icon for Manage Layer Visibility
``` Click on the Manage Layer Visibility icon
From the drop-down menu, select Add preset…
For the Name of the new preset insert Energy map
Click OK ```
To ensure the preset has been correctly set, you can change the visibility of the layer, or change the style, and select the preset from the Manage Layer Visibility menu.
To create the second preset:
``` Hide All Layers from Manage Layer Visibility or simply press Ctrl+Shift+H
Turn on the visibility for London_boroughs
Right-click on London_boroughs and select Style > no label
On top of the legend tree in QGIS, click on Manage Layer Visibility
From the drop-down menu, select Add preset…
For the Name of the new preset insert overview map ```
Now you should be able to switch between those two presets, and later use them as print composer frames.
The map is almost ready to be printed. Before printing, we’ll need to add a border, logos, legends, scale, etc.
There are quite a few steps involved in configuring the print composer so it’s recommended to regularly save your progress by saving the QGIS project.
``` From the main menu, select File > New Print Composer
A new window will appear for Composer title
Type Energy usage in London ```
The print composer title window
The print composer will appear. See Figure.
The print composer window
The print composer is split into two sections. Section 1 shows the map to be outputted and section 2 shows the settings for selected items in section 1.
The map we are going to produce is an A4 landscape PNG file.
In section 2, under Composition, for Presets, select
A4(210 x 297 mm)
Now we need to add frames for the map extent and legend sections. You can add a rectangular shape by clicking on from the main toolbar.
``` From the main toolbar, add a new rectangle
Click and drag a shape in section 1 ```
Now let’s change the position and size of the rectangle:
``` Ensure the rectangle shape is selected in section 1
Click on Item properties in section 2
Under Shape, select Position and size
Set the option as shown in Figure ```
``` Add second, third and fourth rectangles with the following information
Reference Point: Centre
Reference Point: Centre
Reference Point: Centre
Lock the position of each window by right-clicking on each of them ```
Section 1 of the print composer should look like this:
The print composer with placeholders layout
Let’s add the logos.
``` From the main menu, select Layout > Add Image
Click within the middle rectangle on the right
An empty box will appear
In the right-hand panel (section 2), under the Item properties tab,
click on Main properties button
For Path, click on … and browse to the folder where your images are located.
Select an image ```
You should now see something similar to the image below.
Logos added to the composer
Now we’ll add some text in the rectangle below the logos:
``` From the main menu, select Layout > Add Label
Click somewhere within the lower right-hand box
A new text box will appear, reading QGIS.
``` From the right-hand panel, click on Item properties
In Main properties, change the text to refer to the source of the data and copyright notices. ```
Now we’ll add the map from the QGIS canvas.
``` From the main menu, select Layout > Add map
Drag a box in the main window ```
A map similar to the image below should now appear in the print composer.
To finalise the main map window, a few more changes will need to be made.
Adding map to the print composer
``` From the right panel, click on the Item properties tab
Under the Main properties, set the following values:
Tick the box for Lock layers for map item see image below
Tick the box for Controlled by atlas ```
Adding a preset for map view
To add a scalebar:
From the main menu, select Layout > Add Scalebar
Adding a scalebar to the map
A scalebar with default settings should appear on the map. See Figure [PrintComposerAddScalebar]. To change the scalebar:
``` Select the scalebar from the map
Click on Item Properties from the left-hand panel
Set left 0 and right 2
Set Size to 1000
Set Height to 2 mm
Next, we’ll add a legend:
``` From the main menu, select Layout > Add Legend
Click somewhere within the upper right-hand box ```
QGIS will automatically add a legend for all the layers loaded in the canvas. We can edit the legend’s settings and remove the legend entries that we do not want to show. Manual edits of the legend text can also be performed to make it more readable.
To be able to edit the legend items, you first need to untick the box for Auto update. Use icons under the Legend items to edit or change the order of the items.
The default legend
``` From the right-hand panel, click on the Item properties
Under Legend items:
Select London_boroughs and then click on the red minus sign
Select MSOA_GL_ElecUsage and click on the edit sign, a new window will appear.
Change the content of Item text to Electricity
Click on the first value 2576.2400 – 3000.0000
and select edit sign to change the range to 2000 – 3000
Repeat for the rest of the values to round them
and remove any unwanted zeros.
Editing legend values
Map with legend
To add an overview:
``` Add a new map (Map 1) to the place-holder between the map legend and the logos
For Map 1, from the Item properties,
Under Main properties
Select Lock layers for map item
From the visibility preset, select overview map
Under Overviews tab
Click on the plus sign,
Overview 1 should be added to the overview list
Ensure Draw “Overview 1” overview is selected
For Map frame, select Map 0 ```
Setting the preset view for the overview map
The map is now almost ready. You can export it as PNG or a PDF. Or you can keep reading for even more excitement!
The completed map
The map is now ready to be printed or outputted as an image. But, we are going to use this layout as a template and auto-generate energy consumption for each borough.
To set the coverage (this is already set, but make sure the option is enabled):
``` While Map 0 (the main map) item is selected, click on Item properties from the right-hand panel
Select the option for Controlled by atlas generation ```
You can change the Margin around feature if you like, but we can keep at 10%. Further settings are also required:
``` Click on Atlas generation tab from the right-hand panel
Tick the box for Generate an atlas
Under Configuration, for Coverage layer select
Under Output, for Output filename expression type:
The expression for output will set the name of each output file. In this example we are going to have a name with ‘energy_’ combined with the value of NAME column (what do you think this value is?)
To generate the maps:
``` In the print composer, from the main menu, select Atlas > Export Atlas as Images…
Select a folder to output maps and press Choose ```
The process may take a while but you will eventually have 33 maps of the energy consumption for each borough. Note the overview for the maps and also the naming of the output files. See Figure beloq as an example of the maps created.
Final energy map for Kingston upon Thames generated by the Atlas
Last weekend (November 5th – November 8th, 2015) was a special occasion for the QGIS Project – we convened the 14th our ‘hackfest’ meeting!
QGIS hackfests are events where an organiser provides a space for collaboration and members of the community converge and self-organise to improve the QGIS project. We are very much dependent on the good will of our hosts – typically universities – for providing these spaces and the logistics needed to manage the provision of accommodation, food, internet and other needs of our participants over the duration of the hackfest. For this event our gracious hosts were Universitas de Las Palmas de Gran Canaria. Our presence at the University was endorsed and facilitated by:
- Rector of ULPGC: José Regidor García
- ULPGC Manager: Conrado Domínguez Trujillo
- CIO of ULPGC and Director of OSL (“oficina de software libre”, or Free Software Office): Jose Pablo Suárez Rivero.
Councilor of New Technologies Area, Public Administration and Sports at Las Palmas de Gran Canaria Town Hall: Aridany Romero Vega
- Senior professor of computer Science: Agustín Trujillo Pino
- Design: Ramsés Cabello Developer (staff at the event): Jaisiel Santana Almedia
- Developer (staff at the event): Alejandro Sánchez Medina
- Developer (staff at the event): Chano OrtegaTrujillo
- Developer (staff at the event): Moises Bonilla
Our heartfelt thanks to all of the people who worked so hard to make this event happen, and to the participants who travelled from far and wide to attend the event. These events are a significant factor in the success of the QGIS project – they allow our developers and contributors to meet face to face and delve deep into technical issues that would be impossible to do under the somewhat disconnected collaboration environment provided by the internet.
- Qt5 / Python 3 proof of concept by Matthias Kuhn
- Topological editing with GRASS plugin (Radim Blazek) – video (not from event)
- Geoserver explorer plugin (Luigi Pirelli)
- General discussion and planning for the improvement of contribution workflows (pull requests, tickets, QEPs) and infrastructure (Redmine)
- Improvement of analysis tools (ftools, processing) and their documentation
- General bug fixes (Jürgen Fischer)
- Improvements to the QGIS.org website (Richard Duivenvoorde and Anita Graser)
- Implementation of a GitHub webhook to insert a ‘[FEATURE] issue’ so that documenters know to document new features as they are added to QGIS (Richard Duivenvoorde and Raymond Nijssen)
- Processing support for loading Oracle data via OGR (Giovanni Manghi)
- Launched the Italian QGIS User Group, updates to the documentation of Lizmap web client, managed the Italian translation, the python plugin queue (Paolo Cavallini)
Many of the costs not covered by our hosts were covered from central QGIS.org funds including food and travel costs for a number of participants. These funds originate from our donors and sponsorships and are an invaluable resource for the project to allow us to facilitate these events and move the development of QGIS forward. We encourage you to donate to the QGIS or become a sponsor if you would like to foster further innovation and support the long terms goals of the project.
If you would like further information about what was covered in the event, and to get a feel of the general atmosphere of the event, check out some of these links:
- Pablo Fernández Moniz created this collation of photos from the event.
- Anita Graser compiled this great storify timeline of the event.
- Alessandro Pasotti compiled a really great report of his experiences at the event.
I will update the list above as more reports backs become available.
With thanks from your project chair and the whole QGIS community,
In the 12th episode of the QGIS podcast, Tim Sutton and Victor Olaya talk about what they have been doing during the latest QGIS developer meeting, present the latest QGIS enhancement proposals (QEPs), chat about the Processing framework and much more!
Listen to or download it at http://qgispodcast.libsyn.com/qgis-podcast-episode-12-processing-with-victor-olaya
First I wish to thank Pablo & friends for the amazing organization, unfortunately I couldn’t spend more than two full days there, but those two days have been memorable!
Here is a picture of one of the most interesting discussions (photo: courtesy of Pablo).
An hack fest is an event for writing good code but what it’s really good at is to establish and cultivate relations with other coders, to exchange opinions and ideas and last but not least to have some fun and make new friends.
This time, we have had many interesting presentations and a couple of meetings where we spoke about technical aspects of the project management and infrastructure and about some important challenges, both in terms of code size and economical implications for who relies on it, that a growing project must face.
The latter was something I’ve also been considering for a while: now that pull requests (PR) for new features are coming down the pipeline, we must find a better way to manage their queue by giving a clear and transparent approval path and deadline. This management and approval process cannot rely entirely on volunteer work, the main reason being that most of the times the PR proposers have been paid for that PR and it’s not fair (nor reliable) that the (sometimes hard) job of doing a code review is not rewarded. On the other end, an investor cannot waste its time and money on a project without having a reasonable good chance to see its work eventually land into the core of QGIS.
Hugo (thanks for that!) organized a meeting to discuss this topic, that crosses personal business interests, ethical considerations and personal beliefs to a point that it’s not really easy to discuss in a calm and objective way, despite the premises, the discussion was very interesting and constructive and a QEP that tries to address at least some of this problems is open for discussion right now: https://github.com/qgis/QGIS-Enhancement-Proposals/issues/52
Another topic we’ve been discussing was how to manage python plugin dependencies, we’ve decided to start by adding a new metadata tag called external_deps that’s supposed to contain the PIP install string for the required packages, since PIP will be a builtin in python 3.4, that will probably solve most of our problems when we’ll integrate that into the plugin manager. At the moment the metadata is not documented nor required, but it’s there to allow for experiments.
We didn’t miss the occasion to talk about the ugly bug that affects fTools, not something I’m going to dig into in this post though.
Of course an hack fest is still a good opportunity for squashing bugs and implement new cool features, I’ve been busy mainly on the following topics:
- HiDPI screen support for web view widgets (help and plugin manager/installer)
- Form relations editing longstanding bugs
- New feature to optionally enter, edit and store Python form init code into the project (and DB), see the picture below
- Plugins website maintenance (added new metadata and fixed a few bugs, added an RPC call to export author email for admins)
Thanks to all participants, to the organizers and to all QGIS sponsors and donors that made this possible!
The QGIS project is growing in size, number of contributors/contributions and code complexity. This introduces challenges for the project, especially for maintaining quality. Maintaining and improving quality is one of the main concerns of the QGIS.ORG board and some core developers.
Past and current QA efforts
Tim Sutton introduced a first unit test framework several years ago. But it wasn’t very visible then and passing the tests as a prerequisite to make changes to master wasn’t enforced. About a year ago, Matthias Kuhn introduced automated unit testing for the Linux builds – using Travis continuous integration testing. At our github page you can always see whether the master version builds fine and whether the tests are passing – see the green “Build passing” button at the beginning of the Readme.md file.
Since then, OS X automated building/testing was added. Pull requests (new contributions from developers) can be tested prior to integration into the master branch. Another effort was to use coverity code scans to detect memory leaks. Nyall Dawson and others did a lot of improvements/fixes due to this automated code scans.
There is still a lot to do regarding quality and automated testing. Because continuous integration tests were only introduced about a year ago, it means that still a lot of areas in the code base remain untested. Also, the current unit tests do not test GUI interactions. There is an ongoing discussion if critical classes should have unit tests enforced for any code changes. Finally, our bug queue at http://hub.qgis.org/projects/quantum-gis/issues is still quite long, with lots of bigger and minor issues.
Your financial support really matters!
This is where your donations and sponsorships come in. For the past 3-4 releases we were able to pay 2-4 developers who worked for several days concentrating on bug fixing. For QGIS 2.12 we had Nyall Dawson, Jürgen Fischer and Larry Shaffer working on bug fixing. We also financially support Giovanni Manghi for working on our bug tracker (e.g. classifying issues correctly, trying to reproduce the issue, ask bug reporters for more details).
Now – you may wonder why they didn’t fix all the “BLOCKER”s first and then continue on with “HIGH”, “NORMAL” “LOW” issues – and why a lot of unreported issues and issues with label “LOW” were also fixed? The answer is that it is often more efficient for the developers to concentrate on a certain part of the code – e.g. concentrating on geometry, labeling and editing issues, as Nyall did for this round of bug fixing. This means that he would not only fix issues labeled as “BLOCKER” or “HIGH” but also other bugs that are in the same code. Finally, not all of the “Blocker” and “High” bugs are reproducable or the issue may be much too hard/time consuming to fix.
Due to your financial support, the 3 developers were able to fix the following list of issues for the QGIS 2.12 release – many of the fixes also get back-ported to QGIS 2.8 LTS release:
- Sweep of all changed dialogs, ensuring tab order is correct
- UNREPORTED: Only save effect element if it is non-default (decreases size of qgs project files)
- HIGH: Fix map rotation not considered for ellipse marker data defined rotation (#13367)
- HIGH: Maintain order of recent expressions (#13461)
- NORMAL: Make sure recent expression group is always listed last (#13462)
- NORMAL: [diagrams] Fix initial value of transparency slider not set (#13434)
- UNREPORTED: Fix potential crashes in renderer widgets
- NORMAL: Fix legends are empty if presets used with filtered legend (#13300)
- UNREPORTED: Fix crashes and inconsistent ui when atlas is set to a geometryless layer
- BLOCKER: Fix diagrams are always shown, regardless of setting (#13501)
- BLOCKER: Fix fill ring tool used with advanced digitising crashes QGIS (#13355)
- NORMAL: Fix add ring/fill ring tool works on first polygon (#13069)
- BLOCKER: Fix missing sip bindings for renderers (#13545)
- BLOCKER: Fix crash in label property dialog (#13543)
- NORMAL: Fix hardcoded border for raster legend items (#13540)
- BLOCKER: Fix symbols drawn multiple times in rule based renderer if symbol (#13220)
- BLOCKER: Use a model for node editor table, fixed hang when node tool used on large feature (#13541)
- BLOCKER: Fix node tool duplicates nodes when topological editing and snap are both enabled (#13466)
- NORMAL: Fix broken data defined SVG marker outline width (#13423)
- HIGH: Scale svg marker outline width to match context (#11522)
- HIGH: Allow coloring of svg markers and svg fills when used with graduated/categorised renderers (#11658)
- HIGH: Fix svg outline widths are incorrectly scaled (#11522)
- UNREPORTED: Fix snapping options dialog not correctly initialised when loading projects
- UNREPORTED: Fix uninitialized variables in advanced digitizing dock which meant that sometimes advanced digitising tools would be activated unexpectedly
- NORMAL: Fix curved labels ignore line orientation placement flag (#5778)
- UNREPORTED: [console] Move run button earlier in console editor toolbar (prevents it being hidden in overflow menu on small screens)
- UNREPORTED: Fix fill and outline color for svg markers sometimes enabled even though SVG file does not support parameters
- UNREPORTED: Fix svg marker colors not correctly restored from project
- UNREPORTED: If svg files with params do not have a default value set, then don’t reset the fill/border color and border width when changing svg marker/svg fill SVG files (made the behaviour consistent between the svg marker and the other marker symbols)
- NORMAL: Fix svg symbols are shown in white and hard to see in svg picker (#10908)
- NORMAL: Fix refining rule based renderer using expression (#10815)
- UNREPORTED: Fix crash when changing symbol types on windows
- BLOCKER: Fix split parts tool only leaves one of the newly created parts (#13421)
- BLOCKER: Fix using add part tool to add part to geometryless rows (#12885, #11319)
- UNREPORTED: Fix some potential crashes with edit tools and null geometry
- UNREPORTED (thought I’d submitted this years ago but can’t find the issue now): Allow adding features with empty geometry via attribute table
- HIGH: Allow delete part tool to remove geometry from single type point and line layers (#13258)
- LOW: Fix overview canvas background color not set (#11157)
- Add some unit tests for QgsWKBTypes
- NORMAL: When adding ring to a geometry, add z or m dimensions to the ring geometry if required (#7400, #7401)
- NORMAL: Also show features with modified geometry when “show edited and new features” filter is active in attribute dialog (#11684)
- BLOCKER: Fix broken apply button in label config dialog (#13543)
- BLOCKER: Fix area calculation when OTF active and no ellipsoid, add unit test (#13601)
- UNREPORTED: Fix exporting geometry collections to WKT would result in invalid WKT
- UNREPORTED: Fix unable to import WKT using MultiPoint(1 1,2 2,…) format
- UNREPORTED: Fix GeometryCollection WKT to support collections with multi* children and GeometryCollection children (allowed by spec)
- Add a bunch of unit tests to geometry
– UNREPORTED: Fix calculation of area and length of mixed geometry collections
- UNREPORTED: Fix geometry casting in python bindings (missing MultiLineString and GeometryCollection casts)
- UNREPORTED: Fix calculation of length/perimeter for geometry collections
- UNREPORTED: when creating geometry from WKT, upgrade dimensionality of geometry if coordinates are 3/4 dimensional
- UNREPORTED: match dimensionality of collections to child dimensionality
- UNREPORTED: fix area of curves was non-zero if curve is closed
- UNREPORTED: don’t consider m values when testing for curve closedness
- NORMAL: Fix merge attributes tool sets skipped attributes to null (#13231)
- NORMAL: Add skip all option to merge attributes dialog (#6958)
- UNREPORTED: Fix QgsStatisticalSummary sometimes returning 0 for StDevSample stat
- UNREPORTED: Fix storing string representations of doubles in an int field results in NULL rather than converting value to int
- NORMAL: Fix merge attributes/features tool resets values to null for int fields and add a warning if merged attribute value is not compatible with field type (#12842)
- Fix a LOT of leaks relating to geometry and GEOS operations, labeling
- UNREPORTED: [pal] Fix regression in placement for free/horizontal polygon labels
- Add tooltips to advanced digitizing dock
- Fix a crash in filtered legends
- Reviewed and merged several bug fix PRs
- #13433: Help text for rpad and lpad in field calculator are mixed up
- #13417: missing libqgis_app.so
- #13420: Strange behaviour of newly ‘saved as’ project
- #13463: Identify Results panel always show newly created features in the list
- #13538: PostGIS tables containing MultiPolygonZ crash QGIS master
- #13546: qgis trying to update first empty text row with null in db
- #13027: Join by location does not work when layers have equivalent field names
- #13032: Save as… fails to populate fields if layer has similar names only different by case
- #13052: Problem with reshape
- #10747: Cannot copy/paste points features
- #13506: Processing help files for QGIS algs all dead now
- #13274: API combine method for geometry
- #11755: Real precision (Shapefile)
- #9208: QGIS crashes when using addAttributes on any vector data provider
- #13579: Crash Dump 2.11 with user defined expressions
- #10515: QGIS Crash when trying to load a point layer to georss file
- #11276: Setting radius units to meters produces incorrect results
- #13641: editing a feature in a PostGIS layer does not work when the PK contains NULLs
- #13631: when ELSE rule exists in Styling, all Labels are rendered regardless of styling groups being active/inactive
- #13638: Cannot load emptry Postgis views
- #8255: in edit mode changing primary key discards geometry modifications
- #13594: DB Manager – unable to add a Postgres/PostGIS raster as layer
- #13446: MYSQL Project File
- #13310: nightly build packages failing to install with grass error
- (PR#2378: Allow postgis layers from queries to have multiple column primary keys)
- (PR#2376: the test for uniqueness now also works for multiple columns by SebDieBln)
- (#13645: ftools “line intersection” crashes qgis)
- (#13646: Merge shapefiles from fTools crashes QGIS)
- transifex updates & german translation
- attribute editing: don’t allow editing without ChangeAttributeValues capability
- vector layer: avoid some crashs when methods are called on invalid layers
- oracle provider: fix call of sdo_filter to verify a spatial index is present
- #13641: postgres provider: verify unique constraint if NOT NULL is not set on key columns (shortly after release)
- Commit 6a4544f fix fetching of redirected wms capabilities (followup e95bf6d)
EN | PT
Today I needed to create a view in PostGIS that returned the vertexes of a multi-polygon layer. Besides, I needed that they were numerically ordered starting in 1, and with the respective XY coordinates.
It seemed to be a trivial task – all I would need was to use the ST_DumpPoints() function to get all vertexes – if it wasn’t for the fact that PostGIS polygons have a duplicate vertex (the last vertex must be equal to the first one) that I have no interess in showing.
After some try-and-fail, I came up with the following query:
CREATE OR REPLACE VIEW public.my_polygons_vertexes AS WITH t AS -- Transfor polygons in sets of points (SELECT id_polygon, st_dumppoints(geom) AS dump FROM public.my_polygons), f AS -- Get the geometry and the indexes from the sets of points (SELECT t.id_polygon, (t.dump).path AS part, (t.dump).path AS vertex, (t.dump).geom AS geom FROM t) -- Get all points filtering the last point for each geometry part SELECT row_number() OVER () AS gid, -- Creating a unique id f.id_polygon, f.part, f.vertex, ST_X(f.geom) as x, -- Get point's X coordinate ST_Y(f.geom) as y, -- Get point's Y coordinate f.geom::geometry('POINT',4326) as geom -- make sure of the resulting geometry type FROM f WHERE (f.id_polygon, f.part, f.vertex) NOT IN (SELECT f.id_polygon, f.part, max(f.vertex) AS max FROM f GROUP BY f.id_polygon, f.part);
The interesting part occurs in the WHERE clause, basically, from the list of all vertexes, only the ones not included in the list of vertexes with the maximum index by polygon part are showed, that is, the last vertex of each polygon part.
Here’s the result:
The advantage of this approach (using PostGIS) instead of using “Polygons to Lines” and “Lines to points” processing tools is that we just need to change the polygons layer, and save it, to see our vertexes get updated automatically. It’s because of this kind of stuff that I love PostGIS.
The task of projecting, or unfolding the spherical Earth onto a flat map, is an age old problem in cartography. Projection almost always introduces distortion, most projections cannot preserve angles, areas and distances at the same time, they may be conformal (angle-preserving), equal-area (area-preserving) or equidistant (distance preserving) but not all at once. The only exception is a Globe, which preserves angles, areas and distances perfectly. Thus a projection is a compromise.
The choice of projection depends on a map’s use, scale and audience. Conformal projections, for example, are preferred for nautical charts or small scale maps because they locally preserve angles necessary for navigation and survey drawings. Equal-area projections are best suited for maps of broad continental region as they preserve the relative sizes of countries, seas and oceans and allow comparison between regions. Finally, there are hybrid projections that minimise the distortion by merging conformal and equal-area projections, these can be used to create visually pleasing maps of the entire Earth (for a guide to selecting a map projection see Fig. 9 in Jenny (2011), link below).
But how does one measure the degree and type of distortion in a map projection?
One elegant method was developed in the 1880s century by the French cartographer Monsieur Nicolas Auguste Tissot, the Tissot’s Indicatrix (or Tissot’s Ellipse). This mathematical contrivance consists of a grid of infinitely small circles that measures the degree and type of distortion caused by projection. While Monsieur Tissot’s approach is mathematical, involving infinity small circles, his technique can be approximated overlaying a regular grid of large circles and crosses to a map.
The Indicatrix Mapper plugin for QGIS by Ervin Wirth and Peter Kun creates a Tissot’s Indicatrix by adding a vector layer of circles and crosses in a gridded pattern on a map. The degree and type of distortion of the Tissot’s Indicatrix reveals the class of map projection as follows: –
- If a projection is conformal, the area of circles and sizes of the crosses will change while the shapes of circles remain the same and intersection angle of the crosses will always meet at 90 degrees e.g. Mercator projection
- If a projection is equal-area, the area of the circles will remain the same while the shape of the circles change and intersection angle of the crosses will not always meet at 90 degrees e.g. Mollweide projection or Hammer projection
- If a projection preserves neither property, the area of the circles and their shape will change, and the intersection angle of the crosses will not always meet at 90 degrees e.g. Robinson
After adding the Indicatrix Mapper plugin to QGIS (menu Plugins – Manage and Install Plugins) first add a basemap using the OpenLayers plugin e.g. Bing Aerial layer, then click the Indicatrix Mapper icon and run the plugin using default settings. You can then select different projections (lower right in world icon QGIS) to see the effects of various protections on the Tissot Indicatrix. If the circles appear as squares after selecting a different projection, right click the Circles layer in the layers panel, then select the Rendering tab and deselect the Simplify geometry check box. Also, turn off the basemap layer when using different projections, unfortunately the OpenLayers plugin only supports Google Mercator projection (EPSG 3857). To create the basemap below, that can be displayed using different projections, I styled vector data downloaded from Natural Earth and OpenStreetMap.
It is important to note that a Tissot’s Indicatrix generated in QGIS is an approximation of mathematical ideal, we are not no longer dealing with infinity small circles. As a result, here will be some minor distortion visible towards the edge of a map independent of the projection used; notice that the circles in the Mercator projection nearest the poles are not quite symmetrical or the circles at the edge of the Mollweide projection do not appear to preserve area as they should. This anomalous distortion can be minimised by reducing the size and spacing of the circles and crosses created by the Indicatrix Mapper plugin. However, despite these limitations a Tissot’s Indicatrix elegantly reveals the distortion present. This is something to important to understand when when choosing a map projection.
EN | PT
During my professional and personal life, I have worked with much different software, with all kinds of licenses. Most of them would be proprietary, closed and / or commercial code. So why devote my time and learning “exclusively” to Open Source?
Without going into detail about the differences between open source software and free software, there are several reasons why FOSS (Free and Open Source Software) interest me.
The first is obviously freedom. Be free to use the software in any context and for any purpose, without being limited by the costs of software acquisition and / or the rules and conditions imposed by the manufacturer (as many said free (as beer) software do). That allows me to, for example, familiarize myself with its features without having to use piracy, or, as a freelancer worker, develop my work based on my technical capacities rather than my financial ones.
Second, the community and collaborative factor. The fact that open source software is built by user and for users, where the main goal is to enhance the software functionality (and not just raise the number of sales), and wherein each enhancement introduced by an individual or company is subsequently shared for the benefit of the whole community, avoiding duplication and “reinventing the wheel”. This is done in part through a lot of volunteer work and constant sharing of knowledge, either by the programmers or users. Thus, together, we all evolve at the same time as the software itself. In addition, everyone can contribute in some way, by producing code, writing and preparing supporting documentation, translating them into other languages or just by reporting bugs.
Finally, the “costs“. The adoption of open source software in enterprises (including the public ones), allow them to focus their investments in training of the human resources and the possible (and desirable) sponsoring of new features that are essential for their workflow, usually for a small portion of the values to spend on the acquisition of commercial software (that usually “forces” the purchase of features that may never be used).
The QGIS PSC (Project Steering Committee) is in transition to becoming a Board. We are registering the project as a Swiss ‘Verein‘ (Association) which will be known as QGIS.ORG and will function as a not-for-profit company, serving the interests of the QGIS project. The motivation for the transition to a legal entity is described in QGIS QEP (QGIS Enhancement Proposal) #16. The board will be constituted of the same members of the PSC but will gain the executive responsibilities required of our Verein statutes.
New chair and vice-chair
Our long time project founder, Gary Sherman, has stepped down from his role as project chair. I (Tim Sutton) have been elected by the QGIS PSC as Gary Sherman’s replacement by the incoming Board. In addition Paolo Cavallini has been elected as vice chair. Gary will continue to serve as an active voting member of the Board, and will maintain life-long honorary membership on the board.
A special note of thanks
In a world where proprietary GIS software licenses cost many times more than the annual income of most of its citizens, free access to spatial visualisation and analysis tools through QGIS (and its constituent projects such as GRASS, GEOS and GDAL) is a profoundly disruptive force for good.
QGIS is a available to anyone with a reasonably modern computer. It makes the wise utilisation of the earth’s scarce resources and the ability to take care of its citizen’s civic and humanitarian needs based on sound spatial decision-making, that much more possible for a huge swathe of society which would otherwise have been disenfranchised.
Even in developed societies where finance is not necessarily the limiting factor, we cannot underestimate the impact of a software platform that is a freely extensible and shared body of knowledge. QGIS is a platform that enhances the ability of governments and private organisations to deliver services that deeply enrich the lives of their citizens and customers.
Gary’s selfless contribution of the QGIS source code has thus had a far reaching affect on many people’s lives – including my own. Under Gary’s stewardship, the project has evolved from a very basic simple GIS data browser that ran on one platform and could only work with PostGIS data, to a fully-fledged production-ready GIS that can be used on the desktop, in your own custom applications and to serve web maps and services.
Gary has been and will remain an inspirational figure to all of us in the QGIS project – the project he started 13 years ago in 2002. We look forward to his continued involvement on the Board.
Our goal as the QGIS.ORG Board is to continue the work started by Gary and to position QGIS as the de facto desktop GIS application, capable of providing a wide range of functionality and richness of features, so that it is no longer necessary to use proprietary GIS software to understand and manage our world.
We are looking for funders for the QGIS.ORG non-profit company. As a foundation project to many humanitarian, municipal, government, NGO, conservation and industry related FOSS tools, we would like to secure funding for the core QGIS project to hire full-time staff so that we can improve the quality and functionality of QGIS for all our users.
To date we have subsisted mainly on micro donations and small-scale sponsorships for which we are very grateful (keep them coming!). This has been very useful but has never take us to the point where we can employ staff full-time to work solely for the good of the project. We would like to establish a team of full-time developers, documentation writers etc.….so we have quite a mountain to climb!
Over the coming months we will be actively seeking out new sources of funding to support these goals, whilst never losing sight of our core principles of Open Governance, Open Source and Open Community. We hope you will join us and support us in this exciting new chapter of the QGIS project!
- Tim Sutton (Chair)
- Paolo Cavallini (vice-Chair)
- Andreas Neumann (Treasurer)
- Gary Sherman (life time honorary member)
- Anita Graser
- Otto Dassau
- Richard Duivenvoorde
- Marco Hugentobler
- Jürgen Fischer
Incoming QGIS Board Chair
EN | PT
In my last post, I have tried to show how I used QGIS 2.6 to create a map series where the page’s orientation adapted to the shape of the atlas features. This method is useful when the final scale of the maps is irrelevant, or when the size of the atlas elements is similar, allowing one to use a fixed scale. On the other hand, when using a fixed scale is mandatory and the features size are too different, it is needed to change the size of the paper. In this second part ot the post, I will try to show how I came to a solution for that.
As a base, I used the map created in the previous post, from which I did a duplicate. To exemplify the method, I tried to create a map series at 1:2.000.000 scale. Since I was going to change both width and height of the paper, I did not need to set an orientation, and therefore, I deactivated the data defined properties of the orientation option:
ith some maths with the map scale, the size of the atlas feature and the already defined margins, I came up with the following expressions to use, respectively, in width and height:
((bounds_width( $atlasgeometry ) / 2000000.0) * 1000.0) * 1.1 + 10
((bounds_height( $atlasgeometry ) / 2000000.0) * 1000.0) * 1.1 + 30
Allow me to clarify. (bounds_width( $atlasgeometry ) / 2000000.0) is the atlas feature’s width in meters when represented at 1:2.000.000. This is multiplied by 1000 to convert it to millimeters (the composer’s settings units). In order to keep the atlas feature not to close to the margin, I have decided to add 10% of margin around it, hence the multiplication by 1.1. To finish I add the map margins value that were already set in the previous post (i.e.,20 mm, 5 mm, 10 mm, 5 mm)
As one can see from the previous image, after setting the expressions in the paper width and height options, it’s size already changed according to the size of the atlas features. But, as expected, all the itens stubbornly kept their positions.For that reason, it has been necessary to change the size and position expressions for each of then.
Starting by the map item size, the expressions to use in width and height were not difficult to understand since they would be the paper size without the margins size:
((bounds_width( $atlasgeometry ) / 2000000.0) * 1000.0) * 1.1
((bounds_height( $atlasgeometry ) / 2000000.0) * 1000.0) * 1.1
To position the items correctly, all was needed was to replace the “CASE WHEN … THEN … END” statement by the expressions defined before. For instance, the expressions used in the X and Y options for the legend position:
(CASE WHEN bounds_width( $atlasgeometry ) >= bounds_height( $atlasgeometry) THEN 297 ELSE 210 END) - 7
(CASE WHEN bounds_width( $atlasgeometry ) >= bounds_height( $atlasgeometry) THEN 210 ELSE 297 END) - 12
(((bounds_width( $atlasgeometry ) / 2000000.0) * 1000.0) * 1.1 + 10) - 7
(((bounds_height( $atlasgeometry ) / 2000000.0) * 1000.0) * 1.1 + 30) - 12
Changing the expressions of the X and Y position options for the remaining composer’s items I have reached the final layout.
Once again, printing/exporting all (25) maps was only one click away.
Since QGIS allows exporting the composer as georeferenced images, opening all maps in QGIS I got this interesting result.
As one can see by the results, using this method, we can get some quite strange formats. That is why in the 3rd and last post of this article, I will try to show how to create a fixed scale map series using standard paper formats (A4, A3, A2, A1 e A0).
Disclaimer: I’m not an English native speaker, therefore I apologize for any errors, and I will thank any advice on how to improve the text.