Skip to main content
Question

Extract polygons from geometrycollection


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?

10 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • January 17, 2023

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


paalpedersen
Contributor
Forum|alt.badge.img+7
  • Contributor
  • January 17, 2023

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?


paalpedersen
Contributor
Forum|alt.badge.img+7
  • Contributor
  • January 17, 2023

yes its called aggregate in the geometryFilter


david_r
Celebrity
  • January 17, 2023

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.


david_r wrote:

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


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • January 17, 2023
simongreener wrote:

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


david_r
Celebrity
  • January 17, 2023
simongreener wrote:

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


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • January 17, 2023
simongreener wrote:

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!


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