Qgis Spatial Query


"A statement or logical expression that selects geographic features based on location or spatial relationship. For example, a spatial query might find which points are contained within a polygon or set of polygons, find features within a specified distance of a feature, or find features that are adjacent to each other." Definition of Spatial Query Plugin

In other WORDS:

You can select a feature and using Spatial Query allows you to see where a feature crosses, intersects, is disjoint, touches or is within another feature. The features can be a polygon, a point, a line, a buffer, anything. And, for example, once you use Spatial Query Plug-In to find which two features intersect, then a new vector later of this can be made.

Example #1:

I want to find a study area in a building that is near my next class. So, that it would take me 2 minutes to walk to class. (That's about .1333 miles from the building). What I can do is:

  • Create points of possible study areas
  • Create .1333 mile buffers around my class buildings
  • Use spatial query to determine which study places I can choose from that will be within, or touch the .1333 mile distance from my next class.

Example #2:

Using the example posed in the First Tutorial and Second Tutorial by UserMan Ujuval Gandhi, the goal was to find which cities are within a certain distance to a river. Thus, a 10m Buffers were made around each city point and around the river lines. Spatial Query was then used to calculate the how many cities were within a desired distance, how many were disjoint, and how many touch. The easiest way I found to go about the tutorial was to follow the directions in the first, but reference the second to visually help you locate buttons or where functions are (the first uses an older version of QGIS).

The tutorial will provide the data to create a city and river/lake layer on QGIS of the world.

This particular tutorial focused on Europe.

You will create buffers and use the spatial query to calculate which cities' buffers and river buffers lie within 10m of each other.

(For more Information Visit: QGIS Manual: Spatial Query Explanation)


  1. Definition of Spatial Query Plugin
  2. Ujaval Gandhi First
  3. Ujaval Gandhi Second
  4. QGIS Manual: Spatial Query Explanation

Edited by Phuong Tseng