2

In order to record some vegetation along a Dutch highway, I want to create a line feature along said highway of about 25 kilometers. The line feature must be split every 100 meters to create seperate features that can have individual values stored to them.

Instead of manually breaking up the line in segments, I hope there is a faster way to do this.

I am using Qgis 3.03 Girona

3

QGIS has several options to split lines into specific intervals. So if one method doesn't work as expected, you can just use a different method.

  1. One method, as @Erik explained, is to add points with the points along lines tool, then split the line at the points. However, the split lines at points tool doesn't always work as expected.

  2. If the SAGA tool split lines at points doesn't work as expected, you can substitute the native QGIS tool split with lines (note: this is different from the SAGA tool split lines with lines). First convert the points into lines using the geometry by expression tool, and the expression

     make_line( $geometry,  make_point( x($geometry)+1, y($geometry)+1 ) )
    
  3. Another method is to add verticies using the Densify by interval tool. Then split the line using Explode lines.

    • The downside with this method is that the explode lines tool will split the line at every vertex, so if your line already has a lot of vertices it will end up split into too many parts.
  4. The tool, Split lines by maximum length, will split the line into segments no longer than a specified maximum length.

  • Thanks for the comprehensive explanation! I managed to get what i wanted using the GRASS function. I wil however consider your methods. – Tom van Heusden May 25 at 9:07
2

First step: Use the tool points along lines to create a point-layer with points spaced 100 m apart, running along your line.

Second step: Use the tool split lines at points, using the created point-layer to split your line.

You find both tools easily, when searching for them in the tool-box.

  • Thanks for the explanation. The 'points along lines' tool works like a charm. The 'split lines at points' however, causes Qgis to crash every time. I will try and work around it. – Tom van Heusden May 24 at 14:09
  • @TomvanHeusden then maybe try, as @Joseph suggested, v.split.length. Or consider updating your QGIS to 3.4 at least, which is more stable than 3.0 – Erik May 24 at 14:11
  • I will try the GRASS function soon. I updated QGIS, and the algorithm runs now, but does not give the desired result. i.e. the line is nog subdivided and just the original feature gets returned. – Tom van Heusden May 24 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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