Solved

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

  • 29 March 2022
  • 3 replies
  • 10 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?

icon

Best answer by nielsgerrits 29 March 2022, 15:26

View original

3 replies

Userlevel 5
Badge +31

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 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?

Userlevel 3
Badge +26

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.

Reply