I am trying to get specific attributes from a line layer to a polygon layer. The line layer contains a number of pipes that run through a polygon (parcel). They both have the parcel number in common:
The darker the color, the more pipes are within that part of the line layer. I now want to transfer the HIGHEST number of pipes into the polygon layer. What I tried so far was "Join attribute by position" - which is kind of the tool I am looking for. However, this tool is either tranfering the attribute of the first line intersecting the polygon or the one with the most length in it. There is no way to add an expression that lets me filter for the most number of pipes. Any ideas?
1 Answer 1
you should use the aggregate expression for that:
aggregate(layer:='line_layer',
aggregate:= 'max',
expression:="pipe_number_field_name",
filter:=intersects($geometry,geometry(@parent)))
-
I think that's it. Was using aggregate before, but was missing the correct filter. Will do some tests but at the first look this is great!ibdmn– ibdmn2023年07月20日 08:54:09 +00:00Commented Jul 20, 2023 at 8:54
Explore related questions
See similar questions with these tags.
overlay_contains(layer:='line_layer_name', expression:='needed_field_name', filter:=is_selected())