Configure editing form widgets using PyQGIS
As I was preparing a QGIS Project to read a database structured according to the new rules and technical specifications for the Portuguese Cartography, I started to configure the editing forms for several layers, so that: Make some fields read-only, like for example an identifier field. Configure widgets better suited for each field, to help the user and avoid errors. For example, date-time files with a pop-up calendar, and value lists with dropdown selectors.
Using QGIS from conda-forge
QGIS recipes have been available on Conda-forge for a while, but now, that they work for the three main operating systems, installing QGIS from Conda is s starting to become a very reliable alternative to other QGIS distributions. Anyway, let’s rewind a bit… What is Conda? Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and all their dependencies.
QGIS Top Features 2016
A year ago I have asked QGIS’s community what were their favourite QGIS new features from 2015 and published this blog post. This year I decided to ask it again. In 2016, we add the release of the second long-term release (2.14 LTR), and two other stable versions (2.16 and 2.18). 2016 was again very productive year for the QGIS community, with lots of improvements and new features landing on QGIS source code, not to speak of all the work already in place for QGIS 3.
QGIS Features I long for while using ArcGIS
(aka Features that ArcGIS Desktop users might not know that exists) From time to time, I read articles comparing ArcGIS vs QGIS. Since many of those articles are created from an ArcGIS user point of view, they invariably lead to biased observations on QGIS lack of features. It’s time for a QGIS user perspective, so bare with me on this (a bit) long, totally and openly biased post. "Hello, my name is Alexandre, and I have been using.
QGIS Top Features 2015
With the release of the first long term release (2.8 LTR), and two other stable versions (2.10 and 2.12), 2015 was a great (and busy) year for the QGIS community, with lots of improvements and new features landing on QGIS source code. As a balance, I have asked users to choose wich were their favorite new features during 2015 (from the visual changelogs list). As a result I got the following Top 5 features list.
Hack to adjust map symbols location in QGIS
Now and then I get too many map symbols (points) in the same place, and I thought how nice it would be if we could drag n’ drop them around without messing with their geometries position, just like we do with labels. That thought gave me an idea for a cool hack. Choose your point layer and start by creating two new fields called symbX and symbY (Type: Decimal number; Size: 20; Precision: 5).
Calculate polygon centroid's coordinates
I had the need to add columns with the coordinates of polygons centroids. I came up with the following expressions to calculate X e Y, respectively: [code] xmin(centroid($geometry)) ymin(centroid($geometry)) [/code] The expression seems quite simple, but it toke me some time before I realize that, not having a x(geometry) and y(geometry) functions, I could use the xmin() and ymin() to get the coordinates of the polygons centroids. Since this wasn’t the first time I had to use this expressions, this post will work as a reminder for the future.
Labels leading lines with QGIS and Postgis
Recently I had the need to add labels to features with very close geometries, resulting in their collision. Using data-defined override for label’s position (I have used layer to labeled layer plugin to set this really fast) and the QGIS tool to move labels, it was quite easy to relocate them to better places. However, in same cases, it was difficult to understand to which geometry they belonged. I needed some kind of leading lines to connect, whenever necessary, label and feature.
Multiple format map series using QGIS 2.6 – Part 2
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.
Multiple format map series using QGIS 2.6 - Part 1
As always, the new QGIS version (QGIS 2.6 Brigthon) brings a vast new set of features that will allow the user to do more, better and faster than with the earlier version. One of this features is the ability to control some of the composer’s items properties with data (for instance, size and position). Something that will allow lots of new interesting usages. In the next posts, I propose to show how to create map series with multiple formats.
Map corner coordinates in QGIS
Some time ago in the qgis-pt mailing list, someone asked how to show the coordinates of a map corners using QGIS. Since this features wasn’t available (yet), I have tried to reach a automatic solution, but without success, After some thought about it and after reading a blog post by Nathan Woodrow, it came to me that the solution could be creating a user defined function for the expression builder to be used in labels in the map.
Please use the "IN" operador
It’s not the first time I see people that, to select feature by their fields values, use expressions like this: [code language=“SQL”]“field” = ‘value1’ OR “field” = ‘value2’ OR “field” = ‘value3’ [OR …][/code] A more practical and pretty way of doing this is by using the IN operator instead. [code language=“SQL”]“field” IN (‘value1’,‘value2’,‘value3’[,…])[/code] This operator is available in almost every GIS software I know. In QGIS, it can be used even if there isn’t a small little button to click.