I have a layer with parcels ('flurstuecke'
) and a layer with subdivisions ('flure'
). I want to digitize parcels and autogenerate the correct number of the subdivision with an attribute formular.
It works perfectly if the parcel is completely within the subdivision. It works sometimes if the parcel is touching the subdivision (having the same border). But sometimes it doesn't work.
I guess it is because I use 'contains'
in my aggregate function. How could I get the corresponding subdivision-value of the subdivision-feature that is mostly overlapped by the parcel I am digitizing?
I am using this expression:
aggregate(layer:= 'flure',
aggregate:='concatenate',
expression:=flur,
filter:=contains($geometry, geometry(@parent))
)
This is when the expression is working well:
This is when the expression is not working. It should write 001
into the "flur"
field, but it is not happening.