Skip to main content

I use the Aggregator to merge polygons based on one attribute.

  • When the output is Shapefile, multipolygons are created and all works fine.
  • When the output is OGC Geopackage or Spatialite, FME creates a GeometryCollection instead of multipolygons (and I can't use GeometryCollection with others GIS softwares).

I want to force multipolygons instead of GeometryCollection. When I use GeometryCoercer, nothing is coerced.

Thanks a lot for your help :-)

You could try this:

Use AttributeCreator to create the attribute geopackage_type with value wkb_geometry_collection.

That would tell the geoackage writer the geometry is "2D Feature with multiple geometries".

See this link for documentation.


You could try this:

Use AttributeCreator to create the attribute geopackage_type with value wkb_geometry_collection.

That would tell the geoackage writer the geometry is "2D Feature with multiple geometries".

See this link for documentation.

Thanks a lot for your answer!

 

I tried to create the attribute geopackage_type with values wkb_geometry_collection and also wkb_multi_polygon. The new attribute is created but the GeometryCoercer can't export anything:

 

 

I get a lot of warnings messages from GeometryCoercer, like "Cannot coerce from IFMEPolygon to fme_multi" or "Cannot coerce from IFMEMultiArea to fme_multi".

 

If I remove the GeometryCoercer, the 8 multipolygons are exported in my Geopackage but they are GeometryCollection and not multipolygons.

 

Thanks for your help :-)

 

 


Deaggregating before aggregating solved the problem:


If you need to transform a homogeneous aggregate (IFMEAggregate) consisting of only polygons (IFMEPolygon) to a multiarea (IFMEMultiArea), you can just use the GeometryRefiner.