Skip to main content

I would like to do what has been beautifully described on the following blog.  The issue is that I currently have FME2013SP1 and the blog is using newer transformers (NullAttributeMapper and newer functionality of FeatureMerger)

 

 

 http://fme-memorandum-takashi.blogspot.ca/2014/02/merge-two-lists-so-that-elements-will.html

 

 

I am looking for suggestions on how to get the same results but by using what is available in FME2013SP1 (until I am able to get 2014 installed).

 

 

Thank you
Hi, thanks for visiting the blog.

 

 

Assuming you've created two data flows based on the original dataset, features on both flows have ID and List{}. ID contains unique identifier of each original feature.

 

One possible way is:

 

-----

 

1st flow:

 

Explode the list with the ListExploder, and then modify _element_index:

 

_element_index = _element_index * 2

 

The index will be 0, 2, 4, 6, ...

 

 

2nd flow:

 

Explode the list with the ListExploder, and then modify _element_index:

 

_element_index = _element_index * 2 + 1

 

The index will be 1, 3, 5, 7, ...

 

 

Send those flows to the same Sorter; sort features by ID and _element_index.

 

You can then build the required list with the ListBuilder or other appropriate transformer (Group By: ID).

 

-----

 

Hope this helps.

 

 

Takashi

Reply