Skip to main content
Solved

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

  • March 1, 2022
  • 4 replies
  • 167 views

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

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.

4 replies

amdubois
  • Author
  • 25 replies
  • 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+60
  • 2938 replies
  • 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 

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
  • 25 replies
  • 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
  • 25 replies
  • 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