I have a set of points (red in the picture) in a shapefile containing an ID as well as two numeric values representing distances in Meters for each point.

After creating polylines for each point via r.drain-GRASS-tool representing flow paths to the points (green in picture), I now need to extract a segment of each polyline that is between a distance A and a distance B from the corresponding point.

enter image description here

So what I need is a shapefile containing a set of polylines, one polyline for each point that is between a distance A and distance B from the corresponding point. A and B vary between the different points.

I tried creating two sets of buffers around the points, one for distance A and one for distance B and then afterwards use the vector overlay algorithms of QGIS but the buffers for different points may overlap and a line will then be clipped by the buffers of two different points.

Is there a way to solve this problem with the buffers or even an easier way to do the extraction using QGIS (2.18 or 3)/GRASS?

Oh, and it is not possible do it manually by editing the features, because I want to use it on a set of several hundred points.

1 Answer 1


This is possible in the upcoming QGIS 3.4 release (so you could download a nightly pre-released and try straight away).

  1. From the Processing toolbox, run the "Line substring" algorithm

  2. Click the button to the right of the "start distance" parameter, and select your field containing the distance from the start of the line which you want to substring from:

enter image description here

  1. Do the same for the "end distance" parameter.

  2. Choose a destination file path for the "substring" output, and run the algorithm.

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.