4

How do I use the middle polygon to cut a ring in the bigger polygon without moving the middle polygon to another layer in QGIS 3.30?

over lapping polygons

I think there is a way to make this edit in-place without having them on two separate layers. When I select them both and use "Difference" or "Symmetrical Difference" they disappear. Do they really have to be on different layers?

Taras
  • 32,823
  • 4
  • 66
  • 137

3 Answers3

5
  1. Select your polygon which must be edited:

    enter image description here

    editable polygon is already selected in the picture

  2. Edit-> Edit Geometry -> Add Ring

    enter image description here

  3. Make sure that the snapping option is switched on

    enter image description here

    Snapping options window:

    enter image description here

  4. Digitize the smaller polygon (whole) and click the left mouse key to finish ring digitizing and make a ring. At the end, you will get an edited polygon.

    enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
KVO
  • 366
  • 2
  • 20
3

I am not aware of a native QGIS Processing Tool that does what you are looking for.

But some time ago, I wrote a processing script for this. "Conditional Difference" is part of the ProcessX-PlugIn.

Set it up the following:

  • as predicate choose intersects
  • as order by expression use the default setting or simply $area
  • as order by method choose descending
  • choose your layer as source and overlay input

enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
MrXsquared
  • 34,292
  • 21
  • 67
  • 117
3

Having both input polygons on the same layer, you can use the function overlay_contains() to identify polygons that are completely contained within other ones and create the difference between the larger polygon and the smaller one contained in it.

Use Geometry Generator to get the visualization only on your initial layer or run Geometry by expression to get the result as actual geometries, but on another layer (see here for details).

Use this expression (in QGIS versions older than 3.28, use $geometry instead of @geometry):

difference (
    @geometry, 
    overlay_contains(
        @layer, 
        @geometry
    )[0]
)

Screenshot, showing the solution with Geometry generator: the blue hached area is created with the expression: enter image description here

Babel
  • 71,072
  • 14
  • 78
  • 208