7.6.6. Join attributes by location

In section 7.4.1. spatial queries were performed. In a similar manner, different layers and their features can also be spatially linked to each other, e.g. to relate thematic data to known coordinates or geometries:

  1. Go to Vector.
  2. Select Data Management Tools.
  3. Choose Join attributes by location.
  4. Select a target (e.g. bee_colony_locations.shp) and a join vector layer (where the attributes are taken from, e.g. commune_boundary_FR.shp).
  5. Choose how the attributes should be attached to the target layer (by the first matching feature is usually the best choice if text fields are joined, but in the case of numerical attributes different aggregation modes may also be suitable).
  6. Set the path and name for the destination shapefile (Fig. 100).
  7. Click OK
  8. Load the new shapefile into the project by clicking Layer > Add Vector Layer.

Within the Attribute table of the new shapefile, the attributes of the commune layer will be added.

Fig. 100. Attributes of a given layer can be attached to another by the use of a spatial join.