I try to connect one feature from a polygon layer to many in a point layer, using geometry generator and expression calculator in the polygon layer.
If I can connect 1 polygon to all the points,
shortest_line(geometry(get_feature('mylayer', 'myattribute', 'myvalue')),
geometry($currentfeature))
I can't connect one polygon to a set of points i.e. I can't select some points with a specific value in a field.
shortest_line(geometry(get_feature('mylayer', 'myattribute', 'myvalue')),
geometry(*only_the_polygons_with_a_specific_attribute_value*))
I tried get_featureand attribute but I failed.
Is there a way to do that ?
collect()and filter by your specific attribute value; if it's another layer you can do something similar within theaggregate()function – she_weeds Jul 01 '20 at 10:30