Configuring relations

In the Joining layer data recipe, we discussed that joins only append additional columns to existing features (1:1 or n:1 relationships). Using joins, it is, therefore, not possible to model 1:n relationships, such as "one zip code area containing n schools". These kinds of relationships can instead be modeled using relations. This recipe introduces the concept of relations and shows how you can put them to use.

Getting ready

To follow this exercise, load zip code areas and schools from zipcodes_wake.shp and schools_wake.shp.

How to do it…

Relations are configured in Project Properties. The dialog is very similar to the join dialog:

  1. Define the two layers (Referencing/Child and Referenced/Parent), as well as the fields containing ...

Get QGIS: Becoming a GIS Power User now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.