[Qgis-developer] Table joins

Hugo Mercier hugo.mercier at oslandia.com
Mon Nov 25 05:10:27 PST 2013


Hi all,

I have some questions regarding table joins in QGIS.

Looking at the GUI, there are two locations where such "joins" can
currently be declared :
- through the "Joins" tab of a layer's properties (1:1 join)
- through the "Relations" properties of the project (1:N joins)

Relations are very cool when used in edit mode on a layer (see
http://blog.vitu.ch/10112013-1201/qgis-relations).

But nothing appears in the attribute table, there is no new columns
(which is the case for a "Join" definition), so I guess one cannot use
"related" fields for symbology, labelling, and so on (even with some
assumptions on the relationship, like that is really a 1:1 relationship)

This seems a bit confusing to me, because they seem very closely related
concepts (and well-known concepts in databases), I find strange to have
them defined at two locations.

I did not yet have a look at the code, but are there any chance we can
treat fields of a "relation" as first-class fields in a layer ? The idea
would be to use them to define 1:1 (current "joins") and get rid of
layer's "joins".

We are also asked for the possible addition of spatial joins within
QGIS. I would find it nice to be able to define them as "relations".
Probably starting with a 1:1 "intersects" join, but with an open
possibility for 1:N spatial joins (contains, etc.), and why not free
custom user expressions as join predicates (including "left" and "right"
geometries for instance)

-- 
Hugo Mercier
Oslandia


More information about the Qgis-developer mailing list