Skip to main content
Best Answer

OGC GeoPackage output woes

  • December 1, 2021
  • 3 replies
  • 108 views

lifalin2016
Supporter
Forum|alt.badge.img+40

Hi all.

I'm trying to expand an existing workflow, that outputs Shapes and TABs (and FFSs) just fine with an option to output GeoPackages as well. This does not go well.

I'm using dynamic schemas, and merges the relevant schema information onto each feature. Then I use FeatureWriter with "Schema from schema feature" to output the data to a file, to be attached to an email. I normally use ZIP, but in this case I just want to use GPKG.

The first problem is, that the writer ignores the request for dynamic schema, and attempts to output any and all exposed attributes.

The second problem is that each attributes gets the data type TEXT(200).

Is there a trick to have FeatureWriter outputting a Geopackage with dynamic schema ?

Cheers.

Best answer by ctredinnick

I did a test to see how it works for geopackage, and the only quirk I guess is that it doesn't give you the option to truncate - it'll drop and create the tables each time.

 

What I think your issue is, is that in the User Attributes tab of the FeatureWriter, you don't want to see any attributes listed there. In changing from the default Automatic/Manual to Dynamic, they'll be left behind in the list and need to be removed. With a writer set to dynamic, any attributes listed there will be written out every time, as well as the attributes specified in the Schema Feature.

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.

3 replies

ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Best Answer
  • December 2, 2021

I did a test to see how it works for geopackage, and the only quirk I guess is that it doesn't give you the option to truncate - it'll drop and create the tables each time.

 

What I think your issue is, is that in the User Attributes tab of the FeatureWriter, you don't want to see any attributes listed there. In changing from the default Automatic/Manual to Dynamic, they'll be left behind in the list and need to be removed. With a writer set to dynamic, any attributes listed there will be written out every time, as well as the attributes specified in the Schema Feature.


lifalin2016
Supporter
Forum|alt.badge.img+40
  • Author
  • Supporter
  • December 2, 2021

I did a test to see how it works for geopackage, and the only quirk I guess is that it doesn't give you the option to truncate - it'll drop and create the tables each time.

 

What I think your issue is, is that in the User Attributes tab of the FeatureWriter, you don't want to see any attributes listed there. In changing from the default Automatic/Manual to Dynamic, they'll be left behind in the list and need to be removed. With a writer set to dynamic, any attributes listed there will be written out every time, as well as the attributes specified in the Schema Feature.

I concur that this is what I see also. I did manage to get something going by deleting unwanted attributes under the "User attributes" tab.

But doesn't this go against everything that "Dynamic schema" is ?

And it still doesn't explain why everything is output as TEXT(200). This is definitely _not_ Dynamic schema.

Are only certain output formats entitled to be using Dynamic schema, is what I'm wondering ?


lifalin2016
Supporter
Forum|alt.badge.img+40
  • Author
  • Supporter
  • December 2, 2021

I did a test to see how it works for geopackage, and the only quirk I guess is that it doesn't give you the option to truncate - it'll drop and create the tables each time.

 

What I think your issue is, is that in the User Attributes tab of the FeatureWriter, you don't want to see any attributes listed there. In changing from the default Automatic/Manual to Dynamic, they'll be left behind in the list and need to be removed. With a writer set to dynamic, any attributes listed there will be written out every time, as well as the attributes specified in the Schema Feature.

Ah, now I get it.

FME populates the UserAttributes pane regardless of a later Dynamic Schema setting, and any attributes "added" are used outside the dynamic schema logic.

So you have to manually delete every single user attribute in the list, and then dynamic schema works as expected.

This was a little tricky, but it dawned on me, that I've previously used this functionality to add attributes to a dynamic schema.

I haven't seen normal writers do this, only FeatureWriter, which I rarely use.

Thanks for your input.