Managing Attributes

A high proportion of the top 30 transformers are support transformers for managing attributes. These create new attributes, rename them, set values, and delete them.

A key use for these transformers is to rename attributes for schema mapping.


Attribute Managing Transformers

The main attribute-management tasks and the transformers that can be used are as follows:

Task Transformers
Create AttributesAttributeCreator, AttributeManager
Set Attribute ValuesAttributeCreator, AttributeManager
Remove AttributesAttributeKeeper, AttributeManager, AttributeRemover, BulkAttributeRemover
Rename AttributesAttributeManager, AttributeRenamer, BulkAttributeRenamer
Copy AttributesAttributeCopier, AttributeCreator, AttributeManager
Sort AttributesAttributeManager
Change Attribute CaseBulkAttributeRenamer
Add Prefixes/SuffixesBulkAttributeRenamer

Many of these transformers can carry out similar operations, and you can see that the AttributeManager does so many tasks you can use it almost exclusively.


WARNING
Don't misunderstand the BulkAttributeRenamer. It changes the case - or adds suffixes/prefixes - to the attribute name, not the attribute value.

Lists

A list in FME is a mechanism that allows multiple values per attribute. So, where the attribute myAttribute can only contain a single value, the list attribute myList{}.myAttribute can contain multiple values as:

myList{0}.myAttribute
myList{1}.myAttribute
myList{2}.myAttribute

For example, a single polygon representing a forested area, might have a list attribute to record the tree species contained in that area:

TreeList{0}.Species = Oak
TreeList{1}.Species = Chestnut
TreeList{2}.Species = Ash

Various transformers can create lists, others include support for lists, and several are designed to operate specifically on list attributes (for example the ListSorter).


For further reading check out this article on Attribute Management on the Safe Software blog.

results matching ""

    No results matching ""