7

I have a river network (lines) and a .shp with states (polygon). I would like to split the lines at the state boundaries i.e. split lines by polygon boundaries.

Is there a geoprocessing tool to do this in QGIS? I can't merge the lines by the way, since they are meaningfully split into tributaries/main river.

Taras
  • 32,823
  • 4
  • 66
  • 137
  • I have tried using vector geometry/ vector overlay / lines intersect tool. This gives me a point layer where lines overlap. However not all overlapping points were found, and I would still prefer if it can be done automatically. – Elena Wimmerwuchs Dec 18 '14 at 15:03

5 Answers5

12

This is now possible by default in QGIS with the "Intersection" tool.

Taras
  • 32,823
  • 4
  • 66
  • 137
joost schouppe
  • 319
  • 3
  • 6
  • The "intersection" tool clips the lines - it removes lines outside the polygon. This is different from simply splitting, which means cutting lines and including all the resulting parts in the output. – jberrio Jan 18 '24 at 06:48
  • They are splitting by state, so what interests them is rivers split by individual state. Usually, I would expect that rivers outside of the whole set of polygons are not interesting to them. But good word of warning for those that don't want that! – joost schouppe Jan 20 '24 at 13:00
2

Intersect didn't work for me in 2.18 or 3x.

To split road lines by zone polygons I used SAGA - Line Polygon intersection that split the line by the polygon

Then the "Attribute Transfer" plugin conflated the attributes across.

GeorgeC
  • 8,228
  • 7
  • 52
  • 136
2

I did not have success with the Line-Polygon tool. I converted my polygon to lines and then used the SAGA->Vector line tools->Split lines with lines. This worked for me.

kyjote
  • 21
  • 1
1

In the Processing Toolbox under "Vector Overlay" use the "Split with lines" tool.

Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389
0

It can be done with GRASS. v.overlay