2

How can I interpolate a point on each line from the vertex? I need to interpolate each vertex along the line for a certain distance. I need offset on all lines.

Standard QGIS tools shift incorrectly and the direction is lost. I think that the problem can only be solved using the geometry generator, function line_interpolate_point().

enter image description here

How can I generate interpolation across all lines?

enter image description here

I want to get these lines with arrows.

2
  • 1
    I don't understand your question. When I first read it I assumed that you want to create an output point layer, with points located at each input vertex. But then you use the word offset. Please edit your question to include an image showing what the output should look like. – Stu Smith Aug 24 '20 at 14:41
  • Taras, thank you. What does "clip"? I made a buffer and intersection. How can I get arrows on both sides? – curtis Aug 24 '20 at 19:44
1

Let's assume there is a polyline layer "line", see image below.

input


A solution using "Geometry Generator" without line_interpolate_point().

Proceed with RMT > Symbology > Single Symbol > Line > Geometry Generator

input1

Apply the following settings for the arrows at lines beginnings

Arrows_start

And these settings for the arrows at lines endings

Arrow_end

The final result will look like:

result

Note: Arrows at starts or endings can have the same visualization settings, e.g. the same colour. In the above example I made arrows slightly distinguishable.

To maintain the original geometry of lines simply duplicate them and put under the arrows or alternatively add a 'Simple Line' layer in the Geometry Generator, see image below.

result_2

To be capable of having an offset at the line starting or ending point, apply the following expressions

difference(intersection($geometry, buffer(start_point($geometry), 2.5)), buffer(start_point($geometry), 0.5))
for a start point

or

difference(intersection($geometry, buffer(end_point($geometry), 2.5)), buffer(end_point($geometry), 0.5))
for an end point respectively, see image below.

offset

arrows with offset


A solution using "Geometry Generator" with line_interpolate_point().

input2

Settings for a staring point
make_line(start_point($geometry), line_interpolate_point($geometry, 2))

settings_start

Settings for an ending point
make_line(end_point($geometry), line_interpolate_point(reverse($geometry), 2))

settings_end

And get the result:

result2

If the line has to have an offset then apply the following expressions:
make_line(line_interpolate_point($geometry, 1), line_interpolate_point($geometry, 2))
where line starts

and respectively

make_line(line_interpolate_point(reverse($geometry), 1), line_interpolate_point(reverse($geometry), 2))
where line ends.

The graphical output will look as follows

offset2

Afterward you will be able to create arrows over that lines.


References:

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.