4

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?

jpinilla
  • 3,230
  • 1
  • 12
  • 24

1 Answers1

5

Simply add a new symbol layer / Geometry Generator / Linestring and paste your expression. This is for visualization only. To get actual geoemtries, use Geometry by expression (see here for the differences).

enter image description here

Babel
  • 71,072
  • 14
  • 78
  • 208