Following a previous question (Select polygons with other polygons layer?), I select some polygons using the query in the answer to create a virtual layer:

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

It works really well, but my layers contain 1.800.000 (and sometimes more) polygons. So that QGIS freezes and virtual layers only appears few days later. When I am trying to record it, it takes again several days to do that. Since I have to do the operation on several layers, it takes an incredible amount of time (that I do not have). Does someone know an alternative to use that kind of query in an other way to select the right polygons?

  • What do you mean by "select the right polygons"? Is the query not producing correct results?
    – artwork21
    Dec 18, 2017 at 14:19
  • I meant selecting the polygons with more than 50% overlapping for example. But I think I have found the solution elsewhere: link
    – francois
    Dec 18, 2017 at 15:06

1 Answer 1


When I was thinking how to formulate the question, I thought a different way to look for in already-existing answers: I found a solution here: Programmatically finding polygons which are >90% overlapped by another vector polygon layer using QGIS?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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