Skip to main content
Solved

TestFilter not working as expected

  • February 10, 2014
  • 2 replies
  • 27 views

jon
Contributor
Forum|alt.badge.img+5
Using a TestFilter, I want to find matching IDs from two different sources.  The first source is a custom format with a field called ObjectID and the second source is from a FGDB feature class with a field called GlobalID (38 characters instead of 36 for some reason):

 

 

 

 

When I look at the format of each, FME says the following: ObjectID [string(38)]

 

GlobalID [char(38)] 

 

I thought my TestFilter wasn't working since the data types are different.  I added a StringFormatter to change both to a string (Format String: s) and thought this would do the trick.  I didn't or I don't know how to properly configure this.  I also tried removing the curly brackets but that didn't work either.

 

 

I copied the values out from the inspector, and from what I can tell, they are identical and SHOULD pass through the "Attribute Match" port. GlobalID = {1A34BEC4-FE38-4D9C-B280-75CEB5D8B6CB}

 

ObjectID = {1A34BEC4-FE38-4D9C-B280-75CEB5D8B6CB}

 

What am I missing??

Best answer by gazza

A TestFilter isn't the right transformer here, it only works on one feature at a time so you would only get a match if a feature had both GlobalID and ObjectID attributes that were identical.

 

 

Try using a FeatureMerger instead and match on GlobalID and ObjectID and look for matched data out the Merged port.
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.

2 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • Best Answer
  • February 10, 2014
A TestFilter isn't the right transformer here, it only works on one feature at a time so you would only get a match if a feature had both GlobalID and ObjectID attributes that were identical.

 

 

Try using a FeatureMerger instead and match on GlobalID and ObjectID and look for matched data out the Merged port.

jon
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • February 11, 2014
Gazza - FeatureMerger did the trick.  Thanks for your guidance!

 

 

By the way, I just looked at the help for TestFilter/Tester (http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/testfilter.htm) and didn't notice anything about it only working on one feature at a time.  How are you supposed to know that if it's not in the help?