Skip to main content

When overlaying polygons I can get points, lines and polygons in a single result GeometryCollection. I'm sure this is a simple question (and have searched the knowledge base etc), but how do I use FME Workbench to detect such GeometryCollections and then extract just the polygons from the GeometryCollections?

Hi @simongreener​ 

 

What is transformer Geometrycollection?

 

Thanks in Advance,

Danilo


A GeometryCollection is an OGC data type not an FME transformer. An GeometryCollection can contain heterogeneous geometry types such as Points, linestrings and polygons. Here is an example WKT:

 

GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,1 1),POLYGON((0 0,10 0,10 10,0 10,0 0)))

 

I want to extract the Polygon from the GeometryCollection


Deaggregate->geometryfilter(area)


Thank you very much.

I looked at GeometryFilter and it doesn't include GeometryCollections in its filter list. I am interested in doing the following so that I don't have to deaggregate multipolygons that don't need deaggrgating.

GeometryFilter(GeometrCollection)->Deaggregate->geometryfilter(area)

Can this be done?


yes its called aggregate in the geometryFilter


I think it's not necessary to use the Deaggregator, simply use a GeometryFilter set to Area. It will automatically homogenize any collections/aggregates. In case you have several polygons in the same aggregate, the output aggregate will only contain the polygons.


I think it's not necessary to use the Deaggregator, simply use a GeometryFilter set to Area. It will automatically homogenize any collections/aggregates. In case you have several polygons in the same aggregate, the output aggregate will only contain the polygons.

Thanks, I'll check


Thanks, I'll check

The GeometryFilter has a parameter Homogenize Collections - this will need to be set to Yes, then only the area polygons within the collection will pass if geometry type is set to area

image


Thanks, I'll check

The parameter "Homogenize collections" is gone in 2022.2, according to the documentation the transformer homogenizes collections when mode is set to Simple (default setting):

"When in simple mode, Aggregate features are automatically homogenized and filtered based on their component type."

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/geometryfilter.htm


Thanks, I'll check

Ah, good to know. Homogenize collections is set to No as default in earlier versions so the change to simple being the default is bound to catch me out in future!


Reply