1

How to I convert @geometry to canvas units, for use in a geometry generator?

Let’s say that I want to draw a 14.1 mm long diagonal line for each feature in a point layer, using a geometry generator. With the units set to “millimeters”, this works:

make_line($geometry, make_point(x($geometry)+10, y($geometry)-10))

Now, the $geometry function is deprecated, and the docs tell me to use @geometry instead. However, while $geometry apparently gives me the coordinates in canvas units, @geometry seems to give them in the original layer units. Is there a function somewhere that can convert @geometry to canvas units? If there is, I can’t find it...

1
  • Maybe it is possible to use map_scale?
    – Bera
    Commented Jul 28 at 14:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.