Solved

OGC GeoPackage output woes

  • 1 December 2021
  • 3 replies
  • 17 views

Userlevel 1
Badge +22

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.

icon

Best answer by ctredinnick 2 December 2021, 07:43

View original

3 replies

Userlevel 3
Badge +16

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.

Userlevel 1
Badge +22

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 ?

Userlevel 1
Badge +22

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.

Reply