Skip to main content
Question

Concatenate attribute entries from several polygons within an enclosing polygon

  • November 28, 2024
  • 3 replies
  • 30 views

vaspelin
Contributor
Forum|alt.badge.img+2

Hi there, 

 

I have a shapefile with real estates that enclose several buildings. I want each polygon in the real estate layer to inherit the attribute entries for the buildings that lie inside each real estate polygon. Some of these entries will be the same, but I want all unique entries for buildings within the same polygon to be written to the same entry. 

 

For example. Three buildings lie within one real estate with attribute entries “Residence” “Grocery store” and “Recidence”. I want these attributes entries to be concatenated into a single attribute entry, separated with comma, in the real estate layer, but with duplicate entries removed. So, the final attribute entry should be “Resicence, Grocery store” for the real estate polygon. Is there any way to achieve this in FME?

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+62

Yes, you can use a SpatialRelator to handle this. The Real Estates polys should be Requestors, the buildings should be Suppliers and the spatial predicate is Contains.

If you specify to create a list in the Attribute Accumulation part of the parameters you’ll get a list of all building attributes that fall within a real estate polygon. So then a ListDuplicateRemover to remove duplicate entires and a ListConcatenator to put it all in a single, comma-separated, attribute


vaspelin
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • November 29, 2024

Thank you ​@redgeographics, that worked perfectly! 


redgeographics
Celebrity
Forum|alt.badge.img+62

You’re welcome! 😃