QGIS Polygon Selection – Selecting Only Polygons Containing Another Polygon with Select by Location

overlapping-featurespolygonqgisselect-by-expressionselect-by-location

In QGIS 3.16.11 on Windows 10 I have a layer with single polygons.

Given this polygon layer with, I'm trying to select only the polygons that that contain at least one other polygon (A & B)

enter image description here

  1. My first thought was, gonna be easy just do:

    Research tools -> Select by Location

    INPUT: original_layer  
    INTERSECT: original_layer  
    PREDICATE: contain   
    

    But everything got selected. It's acting like contain select polygon that contain but also that are equal. same thing happens with are within.

  2. Then I tried with intermediary layer of slightly inflated polygons and to do the contain on that layer

    Geoprocessing Tools -> Buffer

    INPUT: original_layer  
    DISTANCE: 0.00001
    OUPUT: inner_polygon_slighly_inflated  
    

    Research tools -> Select by Location

    INPUT: original_layer  
    INTERSECT: inner_polygon_slighly_inflated  
    PREDICATE: contain
    

    Then I got selected B, but not A.

Can't find a way to this and which seems quite simple. Is there a way to make a PREDICATE: contain but not equal?

Best Answer

Use "Select by expression" with this expression: overlay_contains(@layer).

enter image description here