Skip to main content
Question

GeometryCollection to multi

  • April 19, 2018
  • 4 replies
  • 380 views

Forum|alt.badge.img

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 :-)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • April 19, 2018

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.


Forum|alt.badge.img
  • Author
  • 2 replies
  • April 26, 2018

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 :-)

 

 


Forum|alt.badge.img
  • Author
  • 2 replies
  • May 3, 2018

Deaggregating before aggregating solved the problem:


takashi
Celebrity
  • 7843 replies
  • May 5, 2018

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