Skip to main content

I have a Geopackage, 458.761 polygons. Using a FeatureWriter, type Geopackage, I tried to store this. Unfortunately I get this error and could not found any logic behind this one:

OGCGEOPACKAGE writer: Feature type 'Road' has geometry type 'geopackage_multipolygon' and cannot accept the current feature with a geometry of type 'geopackage_multisurface'.  Skipping feature
 

FME 2025.1.2.0

Hi ​@lambertus ,

The message describes that the geometry type of a feature mismatched the geometry type specified in the writer feature type. Try setting Geometry Type in the writer feature type with Manual mode according to the actual geometry type of the input features. 

 


takashi is correct: If you set a certain geometry type when creating a Geopackage, Geopackage becomes very strict in what it will allow as geometry. For example, if you select geopackage_polygon, you can’t store multipolygons in there (that one has caught me out more than once...), and you’ll get exactly that error message.

I would select geopackage_geometry for the geometry type. That one actually allows you to mix up geometry types. If it needs to be some sort of area, then use a GeometryFilter just before the writer.


Thanks guys! ​@takashi and ​@s.jager  Works seamingless. My only doubt is that I dont like the Manual Option, in case I forget this and I change something in my workspace, things could go wrong. Is there also an alternative approach?


I dont like the Manual Option, in case I forget this and I change something in my workspace, things could go wrong. Is there also an alternative approach?

That’s why I recommended the GeometryFilter plus the geopackage_geometry setting. The default setting on Automatic is <from first feature>, but if you have different types of geometry that are close enough, From-First-Feature will error the moment the geometry type changes. If you have a mix of polygons and multi-polygons for example, as I almost always have. Using the GeometryFilter you at least can be warned, and act on it (using a Terminator and a Logger for example, or some more transformers that change the geometry to the correct type, redirect geometries to different tables, whatever works for you).

Of course it also depends a bit on what is used downstream, in which case the multiple tables could be a solution. 

But the easiest way of not forgetting, is to add Annotation (plus maybe a bookmark) to the writer with a red, opaque background. I find that is a good way of notifying myself (or others) of something that requires attention.