Question

Value from an overlapping polygon ?

  • 20 April 2017
  • 3 replies
  • 18 views

Badge

Hello,

 

 

1 How do I retrieve the value of an attribute of the polygon (candidate) having the largest overlap surface with another (base)?

 

 

2 How do I retrieve the value of an attribute whose plygones (candidates) represent the largest superposition surface with another polygon (base)?

 

 

Thank you


3 replies

Userlevel 4
Badge +25

Tricky one, thinking out loud here:

Use an AreaOnAreaOverlayer, this will cut up areas where they overlap, calculate the area of each resulting polygon, then Dissolve them back together based on a "base" id. Have the Dissolver create a list and sort that on the area attribute.

Badge +22

Further to @redgeographics answer, after the AreaOnAreaOverlayer you need to explode the list to have one piece per overlap, otherwise the Dissolver will only have the overlap in one of the polygons, and the other(s) will have a gap.

 

 

For what it's worth, when I did this I found it more efficient to drop the geometry after calculating the area, and merge the list back on to the original features with a FeatureMerger, then to dissolve the pieces back together, though I did this back in 2014, and there have been improvements to the dissolver in the meantime.
Badge +3

Don't think you need to dissolve.

AreaOnAreaOverlayer.

1

Calculate area, sort by ID and Area attribute.

Sample 1st of each ID using a sampler grouped by ID.

merge the original objects by ID from the result of the sampler.

2.

After area calculation, aggregate by ID and candidate ID, sum the area . then again sort, now by ID and summed area.

Sample 1st ID and summed area.

Remerge original by ID.

No list building required either me thinks...

Reply