I Need to get a midpoint from a line layer. Property layer -> Style -> Simple symbol -> Generator geometry (line)
I have code #1:
x(line_interpolate_point($geometry, $length / 2)
this code return NULL
I have code #2:
point = $geometry.interpolate($geometry.length() / 2).asPoint()
make_line(make_point(point.x(), point.y()),
make_point( "auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))
this code return NULL
What is my mistake? I am using QGIS 3.8.3
Answer eurojam: Edit code result:
make_line(
make_point(x(transform(line_interpolate_point(transform($geometry,'EPSG: my geographic','EPSG: my project')),'EPSG: my project','EPSG: my geographic')), y(transform(line_interpolate_point(transform($geometry,'EPSG: my geographic','EPSG: my project')),'EPSG: my project','EPSG: my geographic'))),
make_point( "auxiliary_storage_labeling_positionx",
"auxiliary_storage_labeling_positiony")
)