7.4.1. Spatial query and select by location

Similar to ArcGIS (section 6.4.1.), different functions exist to obtain information for defined locations: The Identify Features button text icon20 is the same as the Identify tool of ArcGIS (see section 6.4.1.) and is used to obtain information about specific pixel values within a raster image or to look at the attribute values of a vector feature. Before applying the Identify Features tool, it is necessary to activate and select the appropriate layer in the Map Legend. In addition, various spatial operations are provided within the main menu Vector. Of particular interest is the function Spatial Query that allows more advanced queries by using vector geometries. To demonstrate this functionality with QGIS we will ask for all communes that contain at least one honey bee colony.

  1. Choose Vector from the main menu.
  2. Select Spatial Query (a dialog window will appear).
  3. Select the layer commune_boundary_FR.shp as Source Features and the point vector file with the honey bee colonies as Reference Features.
  4. Choose the operator Contains to be applied between these two features.
  5. Choose to create a New Selection (alternatively, it could be added to or removed from an existing selection).
  6. Click Apply and close the dialog, if the result looks similar to Fig. 81.

Intersection operations can also be applied with the help of the function Select by location:

  1. Go to Vector.
  2. Choose Research Tools.
  3. Select Select by location.
  4. Choose the settings according to Fig. 82 to achieve similar results as displayed in Fig. 81.

In practice, spatial selection operations are frequently used to assign attributes of one layer to another layer and for raster calculation tasks or modelling tasks.


Fig. 81. Result after performing a spatial query: The honey bee colonies are located within 11 different administrative districts around the city of Fribourg. The orange polygon represents the first in the Result Feature ID’s list. Reproduced with permission of Swisstopo (BA13016).

figure081


Fig. 82. Result after performing a spatial query: The honey bee colonies are located within 11 different administrative districts around the city of Fribourg.

figure082

 

 

The BEEBOOK