Solved

How to use an attribute list an input to create filter expression in Custom Transformer

  • 1 March 2022
  • 4 replies
  • 27 views

Hello,

Here is my situation. I have nearly 500 gdbs with exactly the same schema (each gdb contains 7 feature classes). I need to merge only two feature classes. My process also involves a loop and because I do not want to read all the gdb everytime, I have an index shapefile (one feature = one gdb extent) which I intersect with the area of interest in order to extract the names of the targeted gdbs.

 

Right now I have come down to creating a custom transformer which is able to select the good 2 features classes but in order for my filters to work, I need to be able to input the list of the previsouly selected gdb names in my epxression. So far this is what I manage to do.

 

main workbench reading all gdb feature classes and generating list of gbd names to useCustom transformer trying to extract features based on list value 

I know there is something missing but I can't seem to figure out what. Basically, what I need is a way to feed the list of attributes to build the expression that will filter what I need.

 

Thank you for your help!

icon

Best answer by amdubois 2 March 2022, 16:07

View original

4 replies

It turns out my real problem is not actually passing the attribute list, for which finally I just need to use a feature merger at the beginning of my custom transformer.

merge attribute and features 

What I really seem to struggle with is reading the data from a "Any Schema Reader". I'm having trouble understanding how I can pass the values I filtered (basically feature classes) in order to get the actual features and than clip them.

reading data from any schema reader 

Userlevel 6
Badge +33

It turns out my real problem is not actually passing the attribute list, for which finally I just need to use a feature merger at the beginning of my custom transformer.

merge attribute and features 

What I really seem to struggle with is reading the data from a "Any Schema Reader". I'm having trouble understanding how I can pass the values I filtered (basically feature classes) in order to get the actual features and than clip them.

reading data from any schema reader 

This should work, but I think you need to switch Output Ports to Single Output Port.

 

If this doesn't work, I would try to use other attributenames than fme_dataset and fme_feature_type_name to prevent interference with the software.

I have tried also with only one output, same problem.

What attributes should I used if not fme_dataset / fme_feature_type_name ?

The reader seems really the problem. Everything is sent to the initiator section.

No matter what I tried, I always get this error:

error reader schema to gdb

Well I clearly don't know how to make it dynamic but this sequence works.

solution reader schema to gdb

Reply