1

Similar to this question I would like to create lines on points in a point layer. The attribute table of the points layer includes a column named azimuth which contains the azimuth/direction these points are directed to. Using the following expression in the Geometry by Expression tool, I know I can create a line with length of 20 and angle (azimuth: angle clockwise from north) of 112° degrees:

extend (
    make_line(
        $geometry,
        project(
            $geometry,
            20,
            radians(112)
        )
    ),
    20,
    0
)

How can I use the azimuth values (of type Integer64) stored in the azimuth column to set the angle of the lines independently? I tried to substitute 112 with $azimuth in the example, but without success. Any ideas?

1 Answer 1

1

$azimuth suggests you're accessing a property of the current feature - but $azimuth is not defined.

Also, I don't see why you've added extend() to the whole expression.

make_line($geometry,project($geometry,20,radians(azimuth))) works just fine.

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.