Skip to main content
Question

group areas together


bubblebeb
Contributor
Forum|alt.badge.img+6
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. 

5 replies

takashi
Influencer
  • August 26, 2014
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

bubblebeb
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • August 26, 2014
Many thanks Takashi

 

 

I will give it a try. 

 

 

Seb 

bubblebeb
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • August 26, 2014
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 

takashi
Influencer
  • August 26, 2014
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"

 

 


takashi
Influencer
  • August 27, 2014
P.S. If the Dissolver works efficiently, the SpatialRelator and the Tester may not be necessary.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings