Skip to main content
Solved

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


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

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • 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
  • 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
  • March 29, 2022
riverag wrote:

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.


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