Update object variable with vector attribute based on largest overlap
Hi, I've been wondering whether it was currently possible to update an object variable with a vector attribute based on largest overlap. In my case, I have single eCognition objects that overlap two or more polygons from a ground survey. I need to create an object variable containing an attribute from the ground survey polygon with greatest overlap. I have tried two things but without success:
- When I use the "read thematic attribute", it seems to update the object variable randomly, and often giving me the attribute of the polygon with the smallest overlap.
- When I use "update variable" and select the feature "create new Thematic object attribute", objects overlapping two polygons are marked as undefined.
I guess a work around would be to use "assign class by thematic layer", select the attribute and constrain to those objects that overlap the thematic layer more than once (otherwise I would get a lot of classes!). It seems that using that option prioritises polygons with greatest overlap. However, this would result in a classification, not a variable, so I would need to store the assigned class within a variable before removing the classification. Only then could I use my original method to update the variable of those objects with a single overlapping polygon. It is a bit convoluted but it's the only way I have found so far.
Any suggestions to improve efficiency would be extremely welcome!
Was this article helpful?