Skip to main content
Solved

Error reading from and writing to geopackage

  • October 17, 2025
  • 4 replies
  • 62 views

lambertus
Enthusiast
Forum|alt.badge.img+23

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

Best answer by takashi

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. 

 

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

takashi
Celebrity
  • Best Answer
  • October 17, 2025

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. 

 


s.jager
Influencer
Forum|alt.badge.img+21
  • Influencer
  • October 19, 2025

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.


lambertus
Enthusiast
Forum|alt.badge.img+23
  • Author
  • Enthusiast
  • October 22, 2025

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?


s.jager
Influencer
Forum|alt.badge.img+21
  • Influencer
  • October 22, 2025

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.