Question

Process individual files in dynamic setup


Badge +14
  • Contributor
  • 117 replies

I would like to process/transform individual files (shape) on a dynamic workspace. I have managed to setup dynamic input/export of the files from folders and have some global transformations. All that works fine. But I also want to apply additional transformations to some of the individual files. In order to do this I need to break out the files from the "flow", do the transformations and then join them back again. How do I do this? Specifically the separating and merging. I found references to a feature called Fanout, but this seems to have been replaced?


6 replies

Userlevel 4

If you need to apply a group transformers only to some specific files, you can e.g. use a Tester / TestFilter based on fme_basename / fme_feature_type (depending on format) to direct those features to a specific part of your workspace, then joing them back into the general workflow again later.

The fanout mechanism is still there, but based on your question I'm not quite sure that's what you're looking for.

Badge +14

Thanks! It looks like the Testfilter would be a convenient way of separating the files. I have got stuck on how to extract the file names. I have a 20 or so shapefiles that i want to fiddle with individually. They always have the same set of filenames so I would like to use that as key. But I cant find any apparent way of doing this. How do I call file names?

I realize that this is a total n00b question but I suspect that there is something in the FME lingo that I have not caught on to yet. (I looked up fme_basename / fme_feature_type but was none the wiser)

Badge +16

Hi @aron,

You are on the right track these FME attributes are added to features when read via the workbench application and depending on the type of file either the fme_feature_type or fme_basename wil hold the name of the file.

 

to be able to use them use an attribute exposed transformer

 

or expose them in the reader feature type.

 

Badge +16

Thanks! It looks like the Testfilter would be a convenient way of separating the files. I have got stuck on how to extract the file names. I have a 20 or so shapefiles that i want to fiddle with individually. They always have the same set of filenames so I would like to use that as key. But I cant find any apparent way of doing this. How do I call file names?

I realize that this is a total n00b question but I suspect that there is something in the FME lingo that I have not caught on to yet. (I looked up fme_basename / fme_feature_type but was none the wiser)

You are on the right track these FME attributes are added to features when read via the workbench application and depending on the type of file either the fme_feature_type or fme_basename wil hold the name of the file.

 

to be able to use them use an attribute exposed transformer

 

or expose them in the reader feature type.

 

 

Badge +14

Thanks Itay,

Now everything looks "right". But for some strange reason I cant get 'Testfilter' to redirect according to my rule set. Everything gets sent out by 'unfiltered'. Is there some sort of special formatting that needs to be in place when calling file names? I have tried both with and without "". I have tried dozens of different combinations, see example below, but somewhere I am apparently not doing this right.

 

(Sorry for all the beginners questions)

Userlevel 4

Insert an Inspector just before the TestFilter and have a look at the actual values. You can also use a breakpoint, there's a great tutorial here: https://desktopmanualbasic.safe.com/DesktopBasic3BestPractice/3.17.FeatureDebugging.html

Reply