I am trying to build an expression that transforms in real-time using the Geometry generator the geometry from points to ellipses.
The expression I am working with is the following:
oriented_bbox(
collect($geometry,
group_by:=overlay_nearest(@layer,"CLUSTER_ID"))
)
As you can see, from a set of points I create the oriented_bbox object grouped by the nearest and filter by a field. The goal is to add the function make_ellipse
so that, in real-time, it converts the oriented_bbox objects to ellipses:
I have tried to adapt the following expression that has appeared as a solution posted by the user @MrXsquared to this question Making ellipse based on ellipse-like polygon in QGIS:
make_ellipse(
centroid($geometry),
bounds_width($geometry)/2,
bounds_height($geometry)/2,
main_angle($geometry),
45
)
My attempt was as follows but it didn't work. I'm also not sure that the make_ellipse
function can work with the idea of grouping objects by nearest and applying filters.
make_ellipse(
oriented_bbox(
collect($geometry,
group_by:=overlay_nearest(@layer,"CLUSTER_ID")),
),
centroid($geometry),
bounds_width($geometry)/2,
bounds_height($geometry)/2,
main_angle($geometry),
45)