Skip to main content
Solved

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


amdubois

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!

Best answer by amdubois

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

solution reader schema to gdb

View original
Did this help you find an answer to your question?

4 replies

amdubois
  • Author
  • March 2, 2022

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 


nielsgerrits
VIP
Forum|alt.badge.img+54
amdubois wrote:

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.


amdubois
  • Author
  • March 2, 2022

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


amdubois
  • Author
  • Best Answer
  • March 2, 2022

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

solution reader schema to gdb


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings