QGIS Joins and Relates

13 Oct 2015

JOINS

Joins are either 1:1 or Many:1. Same with ArcMap

Joins are made via Layer Properties > Joins

After joining, the target table will display NULL values everywhere when you try to sort any of the fields. Solution: close the output table and then reload, subsequent sorts will be OK. Even subsequent joins will not require a reload.

Prefixes can be added to the output table’s join field names, so that they are easily identifiable after the join. This is done in the Add Join dialog box, “Custom field name prefix”. ArcMap does not provide for custom prefix names; only the join table name is used as a prefix.

At 2.10 you can edit the join properties, via Layer Properties > Joins > pencil button. The resulting changes are dynamic, reflected immediately in the output table’s display. Not available in ArcMap.

A single individual join table can be simultaneously joined to multiple target tables.

Joins cannot be chained (join table joined to target table 1, which in turn is joined to target table 2)

Outer and Inner joins:

Outer joins:

Inner joins:

Selections:

Selections made prior to joining:

Selections made after joining:

Filters (aka ArcMap Definition Queries):

Filters made prior to joining:

Filters made after joining:

RELATES:

Relates are 1:Many (same as Arcmap)

Use the Relations tool

See:

a) Create the relation: - Project Properties > Relations > Add - referencing layer = the table with the “many” records - referencing field = the referencing layer’s relate field - referenced layer = the table with the “one” record - referenced field = the referenced layer’s relate field - id = typically leave blank

b) Then use the QGIS Identify tool. ArcMap uses either the geometry select or attribute select. - Make sure that the layer of interest is highlighted in the TOC - After selecting a feature, a Feature Attributes window will pop up. You get a separate window for each feature selected, and you have to close this window to turn off the id color on the map. Not sure how to export the window’s contents.