Skip to main content
Solved

Finding the sum of an attribute of all features inside a polygon

  • December 4, 2017
  • 8 replies
  • 339 views

Forum|alt.badge.img

Hi there,

I have a bunch of small polygons that each have an AREA attribute, showing their square footage. These are contained within several much larger polygons.

What I need is if Large polygon A contains 3 small polygons, one 100ft, one 50ft, and one 75ft, I want to generate a new attribute in my output that says Large polygon A contains 225ft. The same happens for Large Polygon B, C, so on. My output is essentially the Large polygon layer, but with the additional new attribute.

I did try a spatial relator between the small and large polygons, and then a Statistics Calculator outputting SUM and grouping by the unique ID each Large polygon has, but it seems like the output attribute is the first small polygon contained, not all of them together.

Any insight in what I can do different here to get the correct results?

Best answer by redgeographics

I've taken a different approach:

area-summing.fmwt

First a SpatialRelator to see within which large polygon (the neighborhoods in this case) each smaller one (parks*) is. Then a StatisticsCalculator to calculate the sum of all park areas per neighborhood and a FeatureMerger to merge that information back to the original neighborhoods.

* Yes, I know the parks have a NeighborhoodName attribute, so for the sake of the example I've removed that.

View original
Did this help you find an answer to your question?

8 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • December 4, 2017

Hi @robbie_botha,

Have you tried to use the transformer AreaOnAreaOverlayer?

Enable the option Generate List to get the attributes all polygons inside.

Thanks,

Danilo


Forum|alt.badge.img

Hi @danilo_inovacao,

I'm not quite sure how this would work, seeing as that transformer only has one input port, and I need to be sure that my output is only the large polygons. I might not have been clear about it, but the large and small polygons are two separate layers, and my output can only contain the large ones.


takashi
Influencer
  • December 4, 2017

Hi @robbie_botha, if you check the Generate List option in the SpatialRelator, the values of "AREA" from spatially related small polygons will be stored in a list attribute. You can then sum the values with the ListSummer transformer.


redgeographics
Celebrity
Forum|alt.badge.img+49
  • Celebrity
  • Best Answer
  • December 4, 2017

I've taken a different approach:

area-summing.fmwt

First a SpatialRelator to see within which large polygon (the neighborhoods in this case) each smaller one (parks*) is. Then a StatisticsCalculator to calculate the sum of all park areas per neighborhood and a FeatureMerger to merge that information back to the original neighborhoods.

* Yes, I know the parks have a NeighborhoodName attribute, so for the sake of the example I've removed that.


dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • December 4, 2017

The Dissolver transformer may be of use to you. If your large polygons are separated you shouldn't need a group by option. If they are, hopefully you have an attribute that you can group by. The Dissolver has an 'Attributes to Sum' option.


Forum|alt.badge.img
redgeographics wrote:

I've taken a different approach:

area-summing.fmwt

First a SpatialRelator to see within which large polygon (the neighborhoods in this case) each smaller one (parks*) is. Then a StatisticsCalculator to calculate the sum of all park areas per neighborhood and a FeatureMerger to merge that information back to the original neighborhoods.

* Yes, I know the parks have a NeighborhoodName attribute, so for the sake of the example I've removed that.

Hi @redgeographics,

 

 

I'm a little bad with lists, so your approach appealed to me, and I'm happy to say it worked like a charm.

 

 

Thanks a ton!

redgeographics
Celebrity
Forum|alt.badge.img+49
robbie_botha wrote:
Hi @redgeographics,

 

 

I'm a little bad with lists, so your approach appealed to me, and I'm happy to say it worked like a charm.

 

 

Thanks a ton!
You're welcome!

 

 


takashi
Influencer
  • December 4, 2017
takashi wrote:

Hi @robbie_botha, if you check the Generate List option in the SpatialRelator, the values of "AREA" from spatially related small polygons will be stored in a list attribute. You can then sum the values with the ListSummer transformer.

This screenshot illustrates my intention. FYI

 

 


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