1

I'm trying to divide up polygons in QGIS with a line I've assembled from a variety of constituent parts. The line has been successfully merged into a single object, and as far as I can tell is a continuous single line from end to end. Unfortunately, some of the polygons it's drawn across simply do not respond when using the 'cut with line' tool - nothing happens to them at all.

What could be going on here?

Some of the original parts had gaps between them, but I went in and manually altered all the ones I could find so that each segment of the final line crossed over the previous and next segments. Those crossed segments have resolved into smooth connections as part of the line merge process. The line does extend past the edges of every polygon it's drawn across.

I can provide both the line and the polygon data if that would be helpful.

2
  • 2
    without a screenshot - sounds like there is like a self intersecting polygon or donut polygon..
    – Mapperz
    Commented Nov 17, 2021 at 4:15
  • @Mapperz Turns out the issue is that the line isn't truly a single line - there's points where it's divided into segments, and even though those points are snapped to each other, I can find no way to merge the line into one single line. Any thoughts on how to do that?
    – Sjiveru
    Commented Nov 17, 2021 at 13:50

2 Answers 2

2

The line you provided here (I guess you're asking about this one) is very messy as you "assembled from a variety of constituent parts". So after trying different approaches, I found a way to easily create a valid line that you can use to split polygons.

  1. Buffer the line with a (very) small distance (I used a distance of 0.0001 as your layer units are degrees) - be sure to dissolve the buffer: Menu Vector / Geoprocessing Tools / Buffer.

  2. Convert Polygons to lines: Menu Vector / Geometry tools / Polygons to lines

  3. Manually split this line at the two ends with the Split Features tool enter image description here

  4. Delete either the left or the right hand side of the line and merge the remainig parts.

You are left with a valid line you can use to split. You can download the line I created in this way from here.

As we used a buffer, the resulting line is about 10 to 12 meters away from the initial line. If you need more precision, simply use a smaller buffer-size in step 1. Consider to reproject the line first to a projected CRS so that you can buffer using meters as unit.

Using the line to split the US and Canada with the built-in dataset in QGIS, I get this result (western part of Canada and eastern part of US selected/hightlighted in yellow):

enter image description here

1
  • Finally! Thank you so much for all your help in dealing with this saga. I'm so glad to have this working now.
    – Sjiveru
    Commented Nov 17, 2021 at 16:08
2

Try checking the geometry of the layer using Menu Vector > Geometry tools > Check geometries. You can solve some geometry problems with that and then try again.

1
  • 1
    Turns out the issue is that the line isn't truly a single line - there's points where it's divided into segments, and even though those points are snapped to each other, I can find no way to merge the line into one single line. Any thoughts on how to do that?
    – Sjiveru
    Commented Nov 17, 2021 at 13: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.