I'm working with QGIS 3.16 Hannover. I have a point layer and I want to create a new line layer with features derived from the first one, using the following code
make_line(
-- using an array of points placed around the original
array_foreach(
-- list of angles for placing the projected points (every 90°)
array:=generate_series( 0, 360, 90 ),
-- translate the point 20 units in the given direction (angle)
expression:=project( $geometry, distance:=20, azimuth:=radians( @element ) )
)
)
How can it be done?
