3

Given this polygon:

enter image description here

I'm trying to select the inner one, but can't find a simple way using either selection by location or selection by expression

Any idea?

1
  • 1
    yep same layer, and nope I don't have postgis setup
    – asiera
    Sep 19, 2021 at 11:12

1 Answer 1

3

Use Select by expression with this expression and change the size of the buffer (end of line 2 - here: 0.0001) depending on the size of your polygons/the CRS you use (in most cases, it should work without adaptions).

Explanation: the expression evaluates if the outer boundary of a buffer around a polygon feature is within the nearest neighboring polygon.

within (
    boundary (buffer( $geometry,0.0001)),
    array_first (overlay_nearest (@layer, $geometry))
)

enter image description here

1
  • 1
    Brilliant, once again! you're a champ. The buffer distance shouldn't too much of an issue in my case, as my polygon sizes shouldn't be varying too widely. A minor issue, that doesn't matter in my case but it could for some as this solution would also select polygons that are contain within another polygon. Anyway Thanks again.
    – asiera
    Sep 19, 2021 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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