I have to select some polygons with another polygon layer. I have to select green polygons using relevant overlapping percentage with the purple ones. In this particular example, I would like to select all green polygons except the third one from starting from above for example.

Do you have any advice to do that?

enter image description here

  • 3
    What do you mean by superposition is adequate? Nov 23, 2017 at 11:34
  • I meant something like 'relevant'. Like the answer below, I needed to deal with percentage of overlapping. Sorry for having been unclear. Thanks underdak for the clarification. I will pay extra attention next time
    – francois
    Nov 24, 2017 at 12:43

1 Answer 1


I am not sure how best we can define "adequate". But assuming over 50% of the green polygon is overlapping with purple:

  1. Go to Layer | Add Layer | Add/Edit Virtual Layer
  2. [Import] (greens and purples) layers

An example of query is:

SELECT greens.*   FROM greens, purples
WHERE st_area(st_intersection(greens.geometry, purples.geometry)) 
      > 0.5 * st_area(greens.geometry) 

If you need a higher threshold e.g. 'at least 60% of green polygon has to overlap with purple' then change 0.5 to 0.6.

If you want to decide it by the greens' centroids' location.

SELECT greens.*   FROM greens, purples
WHERE st_within(st_centroid(greens.geometry), purples.geometry) = 1
  • 1
    If it is the centroid, then there is a plugin for that: plugins.qgis.org/plugins/SelectWithin Nov 23, 2017 at 14:29
  • 1
    Thanks @HeikkiVesanto I agree it is another possibility... just added to include centroid option. Yes, I appreciate the plugin, too.
    – Kazuhito
    Nov 24, 2017 at 0:28
  • I am glad @francois. By the way, if you add that information to your question (using edit) it will be reopened.
    – Kazuhito
    Nov 24, 2017 at 16:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.