Advanced QGIS Expressions

QGIS North America · 14K views · 2020 · 22:41

Open on YouTube

Data science & statisticsTesting, debugging & developer toolstalk

Why Geographic Information Systems Stack Exchange recommends it

GIS Stack Exchange users link it when asked how to learn QGIS expressions or how to use aggregate() to reference other layers, such as finding neighbouring polygons or intersecting line lengths.

Recommended by 3 people across 4 different months, 2020 to 2021.

What it is

A 22-minute conference talk by Ujaval Gandhi of Spatial Thoughts for QGIS North America on the QGIS Expression Engine. It covers advanced techniques such as aggregate expressions across layers, fuzzy table joins, shared border lengths between polygons, and automating data QA without plugins or custom code.

What people said

Recommends spatialthoughts · 2020-08 · Geographic Information Systems Stack Exchange · on “Rule for labeling ways not being part of OSM relation in QGIS”

You should be able to use an aggregate() expression to do this, since it allows you to reference another layer. See [this video]

Recommends Babel · 2021-03 · Geographic Information Systems Stack Exchange · on “Create field with length of lines intersecting with polygons”

I learned this expressions simply be reading carefully the explanations in the QGIS expression editor: for every function, you have a help that shows you the syntax etc. to use. I also asked questions here at GIS SE where unsure. A good video tutorial is Ujaval Gandhi's Advanced QGIS Expressions: [this video]

Recommends Babel · 2021-05 · Geographic Information Systems Stack Exchange · on “Create an inscribed square inside a polygon”

I learned using expressions reading the help in the expression string builder - just select a function in the middle part to see a description on the right side. Than try building an expression step by step. Also this site here helped me a lot when I was stucked. For a tutorial, see [this video]

Recommends ThomasG77 · 2021-07 · Geographic Information Systems Stack Exchange · on “Learning how to use QGIS Expressions”

Not sure there is a book. Looking at the expression reference documentation is the best way to tackle all available expressions [LINK] You may also look at video "Advanced QGIS Expressions" [this video] (related to [LINK] )

Cites jpinilla · 2021-03 · Geographic Information Systems Stack Exchange · on “List of polygon neighbours with field calculator in QGIS 3”

I'm using QGIS 3.16 Hannover. I've got a hexagon grid layer and I want to create, with the field calculator, a new field with the id's of the surrounding polygons. I've adapted the following expression from this tutorial [this video] : aggregate( layer:='grid', aggregate:= 'concatenate', expression:= "id", filter:= touches($geometry,geometry(@parent)), concatenator:=', ') But it returns an error An error occurred while evaluating the calculation string: Could not calculate aggregate for: id Why is that?