Skip to main content
Solved

Geopackage Dynamic Writer error - unsupported type 'mediumint'


aegman
Contributor
Forum|alt.badge.img+3

Hi,

 

I'm trying to dynamically write some features to a Geopackage, but constantly get the error `OGCGEOPACKAGE writer: OGCGEOPACKAGE writer: For feature type 'd_y_n', primary key attribute 'fid' has unsupported type 'mediumint'. Primary key must have type 'int'`.

 

I'm reading the schema and features with a FeatureReader, from a PostGIS database.

 

Dynamic writers for other formats seem to be working fine (obviously not tried them all!). And I've tried manually changing the schema in the workbench (by altering the native type attribute), which also doesn't work.

 

If I manually set the output schema it works, but I can't do that...

 

Any ideas how I could resolve this issue?

 

(Using FME 2021.2 on MacOS)

Best answer by kailinatsafe

Hello @Andy E​ , thanks for posting to the FME Community.

It seems like FME is trying to write a 32b integer when its expecting a 64b integer. We can try and use an AttributeCreator to fix this, (see image below):

 

force64bInteger 

Add an AttributeCreator before your Writer, and on your FID attribute, use the following to convert it to 64b integer:

 

@int64(@Value(fid))

 

I think this should allow FME to properly map it. If you try this and it doesn't resolve the issue, please let me know. Best, Kailin.

View original
Did this help you find an answer to your question?

4 replies

kailinatsafe
Safer
Forum|alt.badge.img+21
  • Safer
  • Best Answer
  • April 18, 2022

Hello @Andy E​ , thanks for posting to the FME Community.

It seems like FME is trying to write a 32b integer when its expecting a 64b integer. We can try and use an AttributeCreator to fix this, (see image below):

 

force64bInteger 

Add an AttributeCreator before your Writer, and on your FID attribute, use the following to convert it to 64b integer:

 

@int64(@Value(fid))

 

I think this should allow FME to properly map it. If you try this and it doesn't resolve the issue, please let me know. Best, Kailin.


aegman
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • July 19, 2022
kailinatsafe wrote:

Hello @Andy E​ , thanks for posting to the FME Community.

It seems like FME is trying to write a 32b integer when its expecting a 64b integer. We can try and use an AttributeCreator to fix this, (see image below):

 

force64bInteger 

Add an AttributeCreator before your Writer, and on your FID attribute, use the following to convert it to 64b integer:

 

@int64(@Value(fid))

 

I think this should allow FME to properly map it. If you try this and it doesn't resolve the issue, please let me know. Best, Kailin.

Thanks.

 

In my case I was using a dynamic schema, so I checked the attribute list for a fme_data_type value of "fme_int32,PrimaryKey" and replaced it with "fme_int64,PrimaryKey".


so_much_more
Supporter
Forum|alt.badge.img+6
  • Supporter
  • September 15, 2023

@kailinatsafe​ @Andy E​ How did you solve it for the dynamic writer? I have not been able to find where/how I can replace "fme_int32,PrimaryKey" with "fme_int64,PrimaryKey"


aegman
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • September 15, 2023
so_much_more wrote:

@kailinatsafe​ @Andy E​ How did you solve it for the dynamic writer? I have not been able to find where/how I can replace "fme_int32,PrimaryKey" with "fme_int64,PrimaryKey"

For a dynamic schema, you need to edit the attribute list on the schema feautre(s).

I did this by exploding the attribute list, testing for any "fme_data_type" attributes with a value of "fme_int32,PrimaryKey" and changing those to "fme_int64,PrimaryKey". Then you need to rebuild the list and merge that back on to the schema feature.

Modifying Schema FeatureI also found in some cases I needed to add an entirely new Primary Key attribute for some tables that used non-numeric primary keys, you can use a creator to add a new feature in to the ListBuilder (and also remember to add attribute with the same name to the features too, using a counter is easiest).


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