Skip to main content
Solved

How can I create a simple report of features passing/failing various tests?

  • March 29, 2022
  • 3 replies
  • 193 views

I want to create a workspace that checks input data for various criteria. For example: are there polygons smaller than a certain threshold. Ideally I would like an output in a textfile/PDF, that says "2 features have an area below X". I can calculate the area of the feautres and with a Test_Filter I can redirect the features not passing. What is the FME way to extract the count of those features and write it with a meaningful message to a report?

Best answer by nielsgerrits

Multiple ways to do this. My best practice:

  • Output from tester / testfilter / rejected output port / etc.
  • Aggregator (Mode = Attributes Only, Count Attribute = "number of features")
  • AttributeCreator (AttributeName = "text_line_data", AttributeValue = "@Value(number of features) features have an area below X".)
  • FeatureWriter (Text File)
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.

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • Best Answer
  • March 29, 2022

Multiple ways to do this. My best practice:

  • Output from tester / testfilter / rejected output port / etc.
  • Aggregator (Mode = Attributes Only, Count Attribute = "number of features")
  • AttributeCreator (AttributeName = "text_line_data", AttributeValue = "@Value(number of features) features have an area below X".)
  • FeatureWriter (Text File)

  • Author
  • 14 replies
  • March 29, 2022

This works great and is exactely what I was looking for.

Maybe a little follow up: I do want to write a header to the file, I did this through a Creator + Attribute_Creator similar to your example. Now I notice, that I do not know how to control the order in which the numerous lines appear in the text file. Any advice?


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 627 replies
  • March 29, 2022

This works great and is exactely what I was looking for.

Maybe a little follow up: I do want to write a header to the file, I did this through a Creator + Attribute_Creator similar to your example. Now I notice, that I do not know how to control the order in which the numerous lines appear in the text file. Any advice?

@riverag​ You can create a 'sort' attribute on your header entry = 1, then the other entries will be =2. then simply run them all through the Sorter transformer based on this 'sort' attribute.