I am using geometry generator symbol layer type and some expressions that makes the result a line that is shorter then the original line.
The expression works and looks like this:
However I would like to make my own function that makes it easier to do this operation. Inside the function I am trying to use the make_line expression but this results in an error in the expressions panel when using the function.
My function looks like this:
from qgis.core import * from qgis.gui import * @qgsfunction(args='auto', group='Custom') def smallerline(geometry,value1, feature, parent): tmpline = make_line(line_interpolate_point(geometry,value1),line_interpolate_point(geometry,value1)) return tmpline
I'm using the function in the expression tab but there's an eval error that says "Eval Error: global name 'make_line' is not defined"