Question

Filtering polygons that are completely contained within another polygon

  • 7 September 2022
  • 5 replies
  • 43 views

Hello,

 

I want to select building polygons that are completely contained by an agglomeration boundary polygon - I have been trying this with SpatialRelator and SpatialFilter, however whatever setting I try the transformers always seems to split the buildings that cross over the agglomeration boundary, separating them into two features.

 

Really, what I am attempting to do is just filter through those building polygons that are completely contained within the agglomeration boundary, and disregard those that are partially within and partially outside of it.

 

Appreciate any advice on how to facilitate this.


5 replies

Userlevel 3
Badge +26

I would try sending the polygons to an AreaOnAreaOverlayer. This should create donuts where polygons are completely within the agglomeration. Then, send the features to a DonutHoleExtractor which should output your desired results to the Hole port.

I would try sending the polygons to an AreaOnAreaOverlayer. This should create donuts where polygons are completely within the agglomeration. Then, send the features to a DonutHoleExtractor which should output your desired results to the Hole port.

Thanks ddbrocato - I assume however that this would mean that the attribution of the original building poly dataset would be removed (in addition to where buildings are split into several distinct features sharing boundaries - these would then be represented by a single poly)?

Userlevel 3
Badge +26

Thanks ddbrocato - I assume however that this would mean that the attribution of the original building poly dataset would be removed (in addition to where buildings are split into several distinct features sharing boundaries - these would then be represented by a single poly)?

That is true, but you could use a SpatialRelator with predicate set to Equals to retrieve the original attributes. It would look something like this.

image

Badge +10

Both the spatial filter and the spatial relator should leave polygons untouched.

 

Are you able to share some sample data and your workflow

Both the spatial filter and the spatial relator should leave polygons untouched.

 

Are you able to share some sample data and your workflow

Ah - I've found out the issue! There was an AreaOnArea overlayer buried in a custom transformer I hadn't clocked before (input by a colleague who was working on this tool previously)! I removed that and then spatial relator is working fine now. That's a couple of hours of my life I won't get back!

 

Thanks all for the help (apologies for wasting your time)!

Reply