I want to create a straight line that starts from the point with the given length. And also it rotates around the point.

I have a point data of cctvs:

point data of cctv

And I want to create a line with the given length of 50 meters on each point that rotates at 5 degrees.

To help understand the result would be like this picture for each point.

rotate line


1 Answer 1


You can use Geometry by expression.

This will create a point projected from the center point in the directions 0, 5, 10, 15, ..., 355
at 50 m distance, then draw a line from the center point and the projected point:

array_foreach(array:=generate_series( 0, 355, 5),
 project( point:=$geometry, distance:=50, azimuth:=radians(@element)

enter image description here

It will be a multiline, you can explode it to singlepart lines with Multipart to singleparts


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.