Description

Takes an attribute list (an attribute with {} after the name) and creates a new feature for every entry on that list.

Invalid Lists

ListExploder won’t work with a list which is invalid, such as one that doesn't start at entry 0.


Valid List

mylist{0}.attr1
mylist{1}.attr1
mylist{2}.attr1
mylist{3}.attr1


Invalid List

mylist{1}.attr1
mylist{2}.attr1
mylist{3}.attr1
mylist{4}.attr1

Attributes to Keep

Attributes to keep determines which attributes remain on the exploded features - will it be the entire set of attributes from the source feature, or just the attributes in the List?

When you choose just the list attributes ("List Element Attributes" option) then you need to be aware that this will remove all existing attributes, including format attributes. This means your features won't have an fme_type - and this can cause them to be written incorrectly to a destination (eg as non-geom features).

What might be even more confusing - you won't see the problem if you connect the ListExploder to a Visualizer; the features will appear to have the correct fme_type and fme_geometry. This is because when features are sent to the Visualizer FME converts them to FFS format first which recreates these attributes. The problem would only be apparent if you sent the features to a Logger transformer, where you would see that fme_type is missing.


The solution to this problem is to either keep "All Attributes" or to manually set fme_type after the ListExploder.

Example

The attached workspace shows an example use of the ListExploder transformer.

In this example a spatial dataset needs to be written to a text file as a list of coordinates. The CoordinateConcatenator grabs the coordinates, the AttributeSplitter creates a list attribute and the ListExploder turns the list into a set of records, each containing a single coordinate x/y pair.

Workspace Screenshot

User-added image

Output

The output from the workspace is illustrated by this extract...

3128073.16,10083972.97 
3127925.25,10084156.1 
Pecan Springs 
3135141.57,10083604.43 
3135074.19,10083641.6 
3135145.36,10083797.23 
3135097.49,10084149.31 
3134811.65,10084187.59 
3134939.44,10084419.93 
3135399.46,10084178.3 
3135322.79,10083987.78 
3135141.57,10083604.43 
Dottie Jordan 
3134986.89,10088204.35 
3135021.86,10088216.01 
3135138.43,10088154.81 
3135371.56,10088405.43