Starting from a layer with points geometry, the Geometry generator is used to create a line geometry layer that connects with the 8 nearest points. The function used is the following:
collect_geometries (
array_foreach (
overlay_nearest ('layer_of_points',
$geometry,
limit:=8,
max_distance:=100
),
make_line (
$geometry,
@element
)
)
)
The result obtained, as shown in the attached screenshot, is a set of lines. From this lines I would like to build a geometry expression that allows to detect and generates the 2 largest area polygons (features in blue color on screenshot) that arise from the triangulation of connected lines with points.
Best Answer
I am not aware of any way to do this with the geometry generator directly. But I can propose the following process to achieve the intended result.
If step 1. failed you may need to run "Multipart to singleparts" first, then you need to run "Check Validity", and with the result you need to run "Split lines by lines"