Skip to main content
Solved

Best way of logging counts of an attribute from numerous transformers into csv file??

  • November 15, 2012
  • 1 reply
  • 28 views

Hi there

 

I have a fairly complex workspace and I would like to record the number of items that come out numerous transformers (in particulat feature mergers). What I have done so far is adding a statistic calculator and an attribute creator after each important transformer and I write  the data into a csv file.. The output is presented in two columns: definition of count and count. The problem is that it makes the workspace very messy as it adds a lot of connectors. Is there a simpler way of doing this? This info is recorded by FME anyway as it is displayed on the connectors and in the log file...just wondering if there is an simpler way to log numerous counts into a csv file...thanks

Best answer by davideagle

I'd say you are on the right lines. Though to perhaps make things neater I would bundle your Counter and StatisticsCalculator into a Custom Transformer called something like the 'FeatureCounter' then you can reuse that function in a number of places. Better still if you ad a VariableSetter into the same Transformer and make sure you give each Variable a different name, you could add as the very last Transfromer(s) (one per variable to be retrieved) a VariableRetriever and grab all the feature counts you have generated in your entire workspace and insert them all into a single output file like a CSV. That way you just have one neat write process to create your custom log file.

 

 

http://docs.safe.com/fme/html/FME_Transformers/FMETransformers.htm#transformers/variablesetter.htm

 

 

http://docs.safe.com/fme/html/FME_Transformers/FMETransformers.htm#transformers/variableretriever.htm

 

 

Hope that helps.
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

1 reply

davideagle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • Best Answer
  • November 15, 2012
I'd say you are on the right lines. Though to perhaps make things neater I would bundle your Counter and StatisticsCalculator into a Custom Transformer called something like the 'FeatureCounter' then you can reuse that function in a number of places. Better still if you ad a VariableSetter into the same Transformer and make sure you give each Variable a different name, you could add as the very last Transfromer(s) (one per variable to be retrieved) a VariableRetriever and grab all the feature counts you have generated in your entire workspace and insert them all into a single output file like a CSV. That way you just have one neat write process to create your custom log file.

 

 

http://docs.safe.com/fme/html/FME_Transformers/FMETransformers.htm#transformers/variablesetter.htm

 

 

http://docs.safe.com/fme/html/FME_Transformers/FMETransformers.htm#transformers/variableretriever.htm

 

 

Hope that helps.

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