Question

How to control attribute type and width in the workspace to influence automatic feature definition in writer?

  • 12 December 2022
  • 3 replies
  • 18 views

Badge +5

I like using the automatic feature definition in the writer - attributes are defined automatically based on input.

 

Sometimes I wish I could influence the type and width (string length, field width) of the attribute within my workflow, to ensure the attribute is written out correctly. I know I can switch to manual feature definition and change it there but that makes things harder.

 

I've tried a number of transformers but I could not find any that would influence how the automatic setting interprets the attribute.

 

Does anyone know of a way to do this?


3 replies

Userlevel 6
Badge +33

I think the SchemaScanner is currently the best way to do this. This will generate a Schema Feature, based on the attribute types in the data, which can be used in a FeatureWriter set to Dynamic Writing. See the article How to Use the SchemaScanner Transformer.

 

As an alternative you can try to create a new or modify a existing Schema Feature.

 

A third alternative, to set attribute types in workbench, is in development according to this idea.

Badge +2

@ekkischeffler​ SchemaScanner gives FME's interpretation of the data types. If you can, use FeatureReader <Schema> port - that returns the schema derived from the source data model, so might be more representative of what you want. Then ListSearcher to find where in the attribute{} list the attribute you want to influence. But both options mean you have shifted to a dynamic writer. The idea that @nielsgerrits​ refers to is under development.

Badge +5

Thanks @nielsgerrits​ and @Mark Stoakes​ - I already thought a dynamic writer would be required.

I'll keep it simple, using the automatic definition where possible and hopefully the Attribute Manager will see an update soon!

Reply