I have a set of 13 surfaces that represent land lots. Two of them are divided by roads, so it looks like there were four. I am trying to rearrange the branches of the tree so it would have one branch for every complete plot, meaning that there should be only 11 branches (9 coantaining 1 surface and 2 containing 2 each).
I have assigned different numbers to every plot to identify them, repeating only when needed, so i can extract and rearrange the indexes and group them in branches accordingly. It seems to work in terms of the indexes, but i have not been able to construct a new tree with the new branches.

In the end, I need to extract the areas of the plots and be able to manage them as a complete entities.

In the model, the order of the “lands” is given by the “Y” value of the centroid. So they go from top to bottom. That gives one index number list. Then, I created a second list, with indexes of “groups”:

The first Item goes to> First Group
Second Item > Second group
Third Item > Third group
but Five item >Third group
And so on…

It is adapted from the default Expression component (Maths | Script | Expression) using only one value instead of two and rounding the value to two decimal places.