Skip to main content
I need to find a way to group sets of polygons together geographicly where they overlay each other and then filter out all except the largest extent. 

 

I also want to retain the attributes for the largest extent as well. 

 

Below is a screenshot of the sample data I am using to develop the workspace. I have a total of around 27,000 features to run through this so it can't be done manually. 

 

 

 

This is a sample of the issue. I want the result to have the outer extent of the groups and, in this example, to have 2 features with the attibutes of the largest polygon in the group. 

 

 

Any ideas welcomed. It appears to be such a simple task but I can't seem to work it out. 
Hi,

 

 

This might be a solution.

 

-----

 

Add temporary ID (e.g. _tmp_id) to every polygon with the Counter.

 

Branch the data flow into two flows, connect one to the Requestor port, another to the Supplier port of the SpatialRelator.

 

Parameters of the SpatialRelator are:

 

Tests to Perform: WITHIN

 

Related Suppliers Count Attribute: _related_candidates

 

Attribute(s) that Must Differ: _tmp_id

 

 

The largest extent polygons should not be within any other polygons. i.e. _related_candidates of them should be equal to 0.

 

So, you can filter the output polygons with the Tester to get the required polygons.

 

 

 

Takashi
Many thanks Takashi

 

 

I will give it a try. 

 

 

Seb 
Takashi

 

 

This works really well. 

 

I have found a few where the largest extent is intersected slightly by another polygon. In this instance the tester removes all polygons. Do you know if there is a way of finding these and just taking the largest area polygon in the group with the attributes? 

 

 

 

 

Many thanks 

 

Seb 
The Dissolver keeps attributes from one of the dissolved features with largest area.

 

See help on the Dissolver.

 

So, try adding these transformers after the Tester.

 

-----

 

Dissolver

 

Keep Input Attributes: Yes

 

FeatureMerger

 

Join On: "_tmp_id"  to "_tmp_id"

 

 


P.S. If the Dissolver works efficiently, the SpatialRelator and the Tester may not be necessary.

 

 


Reply