2

picture 1

picture 2

picture 3

So I have this polygon (picture 1) that will be used to make its bounding geometry as shown in the second picture.

After making this bounding geometry, I wanted to make the difference polygon from both polygons (polygon 1 and the bounding geometry). The result is shown in the third picture.

The result from the Difference function is shown. It is a single polygon. However, I want to split the polygon into two polygon with its own area. Is there any way to split the polygon from picture 3?

2 Answers 2

3

Run multi to single-part, which splits multi-features into singular features for the whole layer.

2
  • I have tried the function. However, it is still not split. Instead of making two different features for the area on the left and right, the function makes two different features for the blank area and the filled area.
    – Yosua
    Commented Nov 29, 2023 at 6:41
  • This method should work. Could you provide the geometry created by the difference as a WKT or another format?
    – Kalak
    Commented Nov 29, 2023 at 9:40
1

The difference operation doesn't seem to erase the top part entirely as there are still lines visible on the yellow background.

Possibly the input polygon is slightly tilted. If this is the case, you could try using the "Oriented minimum bounding box" tool in the QGIS toolbox instead of using a standard bounding box:

This algorithm calculates the minimum area rotated rectangle which covers each feature in an input layer.
See the 'Minimum bounding geometry' algorithm for a oriented bounding box calculation which covers the whole layer or grouped subsets of features.

Another/additional option is to use the grid_size option in the difference tool. This parameter will lead to the coordinates of the result being rounded to the tolerance specified and will lead to pieces of a polygon that are narrower than the tolerance to be removed. You'll have to play around a bit to find the correct value:

enter image description here

If these things lead to the "line" to disappear, applying the "Multipart to singleparts..." tool should seperate the multipolygon to seperate polygons.

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