4

I have polygon that has "holes" in it (green polygon), and I want to split it using lines so I will get 2 new polygon. I am unable to do it in QGIS 3.18. But if I cut it using line that crossing whole polygon, it worked well. Any clue?

enter image description here

Files: https://we.tl/t-wUAc6EYuGO

0

1 Answer 1

4

There are two problems:

  1. Your geometries are multipart geometries. Convert them to single part geometries.

  2. You must have a continuous line throught the whole polygon: splitting the polygon with the blue line works, but not with the red lines. The lines are treated separately for the split if you have separate lines. Connect them if you want to use them together to split.

Consider one of the red lines (the upper one): if you have only a line reaching from the outside to the hole, you won't split the polygon, because of what is to the left of the line still is contiguous with what is to the right of the line. So this operation will not result in any split. Now add the second red line (the lower one) and repeat that: still no split.

When you connect the two red lines inside the hole, the polygon will split correctly.

Blue line will split the polygon, red lines will not: enter image description here

5
  • a split along either of the red lines doesn't produce a valid simple polygon
    – Ian Turton
    Commented Jul 1, 2021 at 16:09
  • @Ian_Turton :That's why they have to be connected to a single line like the blue one. Or didn't I understand you correctly
    – Babel
    Commented Jul 1, 2021 at 16:14
  • No, that's correct. I was just clarifying why you couldn't use the red lines
    – Ian Turton
    Commented Jul 1, 2021 at 16:24
  • How if I have huge polygon and want to split it using lot of lines? Actually, I want to make multiple polygon just like maritim.bmkg.go.id/public_api/static/wilayah_perairan.json I have polygon of sea and want to split it to make a coverage. I think, connecting all lines I have is not a good choice...
    – panoet
    Commented Jul 1, 2021 at 19:41
  • If you want to split, you have to use a connected line, that's how things work, unfortunately. I'm not quite sure what exactly you have and what you want to achieve. Plase post another question here for further unclarities - or update this question here if it's just adding details. From your comment, I'm ot sure what exactly you want to achieve.
    – Babel
    Commented Jul 1, 2021 at 19:50

Your Answer

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

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