Skip to main content

I’m not sure if there is already a Hub or Custom Transformer for this, but posting my own version up called “FeaturePrioritizer” for any comments or use.  I may upload this to the Hub if some belief is useful. 😉

FeaturePrioritizer is a helper when the user needs to change the order of Features coming out of an Output Port to feed into a downstream Transformer or Writer that has a dependency on the order that features come into it.

This is commonly needed when needing to say: Make sure that the first feature entering a Writer/FeatureWriter is a Schema Feature, or say when using an Aggregator that the output Attribute Parameter has been set to take only a single feature in the group (Eg.. The first feature in the group to enter the Transformer)  to use as the Attribute output.

Not much to it, behind the scenes this just uses a temporary sorting ID and a Sorter, but puts this all into a single Custom Transformer to make it easier.

As an example, here is a set of Features their original order as output from a Creator

 

Now if send the last 2 Features to the “OutputFirst” Port of the FeaturePrioritizer, it will make sure they come out of the Output Port first, rather than as their original order as the Last features.

 

Be the first to reply!

Reply