Skip to main content
Question

Is there a way to automatically filter out the values of a feature with the use of a testfilter?

  • September 25, 2020
  • 3 replies
  • 357 views

I am using a test filter to filter out all the different values of a feature type. 

In this case there are 21 different values, so I have to manually create 21 different test conditions. Is there a way to automatically create the test conditions?

 

I also have features with more that 50 different values, which would be a lot of work to filter out manually.

 

 

 

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+47

If it's single, unique, values you want to test for you can use the AttributeFilter and have it import those unique values from your source dataset.


dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • September 25, 2020

You can use a FeatureTypeFilter based on the current input. There is an update button within the transformer that will import all feature types automatically.

 

On a slightly unrelated note, I notice that most of the feature types in your example are being used in a common process next. Instead of using '=' and many output ports, you can use the 'In' operator and use only one output port. Feature types just need to be comma separated in the right value. It helps to clean up the workbench, and is easier to build the test.Capture

 

Or you can rename the output port to get the same result...

Capture2


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • September 28, 2020

Another solution might be to run the workspace with caching up until the TestFilter. Then you can use the caches values in the test conditions. You still have to create separate tests, but at least you aren't having to type in values all the time. You'll need FME2020.1 or newer to handle this.

Alternatively, the FeatureTypeFilter might help.


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