Skip to main content
Solved

Iterate independently over files (and don't merge features)

  • October 26, 2022
  • 3 replies
  • 33 views

Hello,

 

I use a Reader to list files inside a directory, connected to a FeatureReader to read the features.

 

Currently, all features of all files are merged. ie. if I have 100 files with 100 features each, the output of FeatureReader will be 10.000 features.

 

Is it possible to iterate incrementally over each file, ie. to execute a pipeline independently for each input file, so that the FeatureReader will be executed 100 times with 100 output features ?

 

Thanks!

Best answer by dustin

If you put the FeatureReader and everything downstream into a separate workspace, you could feed your 'files' reader into a WorkspaceRunner. For each file that enters the WorkspaceRunner, it would process that independently in the 2nd workspace.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

DanAtSafe
Safer
Forum|alt.badge.img+19
  • Safer
  • 344 replies
  • October 26, 2022

@0x974​ The FeatureReader is triggered when a feature enters it. In your case it is "executed" 100 times. After the FeatureReader you'll need to group by the fme_basename or another attribute value that is unique for each input file. Those 10,0000 features should come out of the FeatureReader in the same order that the 100 files went in.


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 627 replies
  • Best Answer
  • October 26, 2022

If you put the FeatureReader and everything downstream into a separate workspace, you could feed your 'files' reader into a WorkspaceRunner. For each file that enters the WorkspaceRunner, it would process that independently in the 2nd workspace.


  • Author
  • 21 replies
  • October 31, 2022

If you put the FeatureReader and everything downstream into a separate workspace, you could feed your 'files' reader into a WorkspaceRunner. For each file that enters the WorkspaceRunner, it would process that independently in the 2nd workspace.

Yes, I did this, that worked like a charm. Thanks!