Skip to main content
Solved

Find attributes that meet the tester requirement


marta.podsiad
Supporter
Forum|alt.badge.img+9

HI,

 

I have a gdb with a lot of feature classes and I need FME to search thoroug the content of each layer and give me the list of all attributes from each layer that meets certain tester requirements. I was thinking of usint Attribute Validator but the content of the gdb will be changing hence adding attributes manually to each tester is going to be very time consuming. I need FME to search thorouhg the content of each layer saved in the gdb and give me the attributes

 

Best answer by hkingsbury

Okay, i’ve found a bug in the custom transformer; this is one we (Abley) have made.
I’ve updated it on the hub (now version 3). You can edit your existing instance like so...

If you edit the custom transformer (right click, edit)
 


Then open up the PythonCaller towards the right of the canvas
 

At the bottom in the Attributes to Expose box, make sure the values read:

1_found{}.value _found{}.attribute

 

View original
Did this help you find an answer to your question?
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.

10 replies

redgeographics
Celebrity
Forum|alt.badge.img+58

So just to be clear, do you want to test on attribute names or attribute values?


virtualcitymatt
Celebrity
Forum|alt.badge.img+45

Hmm, maybe the AttributeExploder? This will create a new feature per attribute

so attributeName and attributeValue 

You need to be a bit careful because this can create a tonne of features - but it should make it so you can just test the attribute value for whatever you want and you can easily get back the attirbute name and the feautre_type_name


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • February 14, 2024
virtualcitymatt wrote:

Hmm, maybe the AttributeExploder? This will create a new feature per attribute

so attributeName and attributeValue 

You need to be a bit careful because this can create a tonne of features - but it should make it so you can just test the attribute value for whatever you want and you can easily get back the attirbute name and the feautre_type_name

Using the list option in the AttributeExploder might be a little more efficient than the feature option in this case. 

A python solution might be the better solution here, but more clarification needed as @redgeographics mentioned.


nielsgerrits
VIP
Forum|alt.badge.img+60
virtualcitymatt wrote:

Hmm, maybe the AttributeExploder? This will create a new feature per attribute

so attributeName and attributeValue 

You need to be a bit careful because this can create a tonne of features - but it should make it so you can just test the attribute value for whatever you want and you can easily get back the attirbute name and the feautre_type_name

 

Or save it as a list and use a listsearcher.


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • February 14, 2024

I need to test the values of attributes. The issue is that the name of the attributes may change


hkingsbury
Celebrity
Forum|alt.badge.img+62
  • Celebrity
  • February 14, 2024
marta.podsiad wrote:

I need to test the values of attributes. The issue is that the name of the attributes may change

Have a look at the AttributeValueSearcher :)
https://hub.safe.com/publishers/abley-limited/transformers/attributevaluesearcher


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • February 15, 2024

That is almost perfect. Is there a way to show only the attributes that meet the regex? For example I would like to see only MulipleLines as it meets the regex

 


hkingsbury
Celebrity
Forum|alt.badge.img+62
  • Celebrity
  • February 15, 2024
marta.podsiad wrote:

That is almost perfect. Is there a way to show only the attributes that meet the regex? For example I would like to see only MulipleLines as it meets the regex

 

 The matched attributes are in a list called “_found{}”
 

 


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • February 17, 2024

thank you for the hint but the _found{} list is empty althouth the value is present in the Found port. What am I doing wrong?

 

 


hkingsbury
Celebrity
Forum|alt.badge.img+62
  • Celebrity
  • Best Answer
  • February 18, 2024

Okay, i’ve found a bug in the custom transformer; this is one we (Abley) have made.
I’ve updated it on the hub (now version 3). You can edit your existing instance like so...

If you edit the custom transformer (right click, edit)
 


Then open up the PythonCaller towards the right of the canvas
 

At the bottom in the Attributes to Expose box, make sure the values read:

1_found{}.value _found{}.attribute

 


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