Skip to main content
Question

GeometryCollection to multi


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

4 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • 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
  • April 26, 2018
erik_jan wrote:

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
  • May 3, 2018

Deaggregating before aggregating solved the problem:


takashi
Influencer
  • 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.


Reply


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