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...
map_scale
?