Geometry Missing in Clipped Output when Writing to GeoPackage in FME
I am working with a table from a GeoPackage in FME, reading it and clipping based on intersections between categories. When writing the output, the unclipped parts are successfully written to Writer 1 without any issues in the output GeoPackage. However, the clipped parts are written without geometry, even though I can see the attributes correctly in the visual preview on the attribute expose just before writting.
I'm confident that I’ve set the geometry type correctly in the writer. What could I be missing here?
Page 1 / 1
This should just work as expected. Can you confirm the writer type is OGC GeoPackage? How do you check the result, have you opened the geopackage in QGIS?
@nielsgerrits This is my writer. I have opened it in QGIS and i cannot see the geometry only the attribute
@nielsgerrits I used the GeometryExtractor and saw that after clipping, the geometry type became a GeometryCollection. I then used the Deaggregator after clipping, and the problem is now solved.
@nielsgerrits I used the GeometryExtractor and saw that after clipping, the geometry type became a GeometryCollection. I then used the Deaggregator after clipping, and the problem is now solved.
Ah yes geometrycollections and QGIS.
@nielsgerrits why does clipper cause this? Do you know?
Hard to say without seeing the geometries, but I suspect that the way the geometries are clipped, the outside featrue has 2 geometry parts. If the clippee is a horizontal bar and the clipper a vertical bar, the outside result is one feature with two geometry parts. That is an aggregate.
I think QGIS does support multipolygons, but it might be possible the aggregate created by the clipper is not the type of aggregate QGIS can handle. But I think it is possible to recreate the aggrgate in the way QGIS likes them using deaggregators and aggregators.
QGIS does support multipolygons
It does. But it has to be a proper MultiPolygon, consisting ONLY of proper polygons (possibly with holes and islands). But a lot of databases, storage solutions and applications do not like Geometry Collections. It’s a subtle difference, but it does prevent from writing quite often. I’ve been bitten by this one as well. For FME it is the safe option, since you can’t be 100% sure what types of geometry result, but in the more strict applications/databases it can cause a refusal to store/display/deal with the result. So the safest way is to use a GeometryFilter before re-aggregating geometries.