Skip to main content
Solved

How to include C++ code into a Workbench?

  • January 19, 2020
  • 2 replies
  • 42 views

Hi there, I would like to use a Conditional Region Growing algorithm from the PCL library (See tutorial) inside a workbench. I make some point cloud preprocessing using vector features and then, at some point, I would like to introduce this algorithm and go further with my processing.

 

How can I make use of that? I have tried with Python bindings using PythonCaller but it is not so helpful in this case.

Is there a chance that this solution will work? :

-> Preprocessing... -> SystemCaller(call .exe file triggering C++ algorithm) -> grab results (still within FME) -> process further

 

Would you like to share some other possible solution?

The biggest advantage of FME is that you can construct pipeline from A to Z and you do not have to interrupt it. I can, of course, export results after preprocessing and then that get back to FME but it is not what I would like to have at the end.

Best answer by takashi

HI @oloocki, I think the solution using the SystemCaller is an appropriate approach to embed an external program in to an FME workspace.

In short, if the program requires an existing file as the source data and the result will be saved as a new file, create a source file with the FeautreWriter after preprocessing, build a command line using the source file path and the destination file path, then run the program through the SystemCaller. After executing, you can read the destination file with the FeatureReader and continue subsequent processes defined with FME transformers.

preprocessing -> FeatureWriter -> build a command line -> SystemCaller -> FeatureReader -> processes

There are some custom transformers applying that approach published in the FME Hub - e.g. LAStools.lasclassify etc. You can see their definition with FME Workbench (add the transformer onto the Canvas, right-click > Edit).

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.

2 replies

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • January 19, 2020

HI @oloocki, I think the solution using the SystemCaller is an appropriate approach to embed an external program in to an FME workspace.

In short, if the program requires an existing file as the source data and the result will be saved as a new file, create a source file with the FeautreWriter after preprocessing, build a command line using the source file path and the destination file path, then run the program through the SystemCaller. After executing, you can read the destination file with the FeatureReader and continue subsequent processes defined with FME transformers.

preprocessing -> FeatureWriter -> build a command line -> SystemCaller -> FeatureReader -> processes

There are some custom transformers applying that approach published in the FME Hub - e.g. LAStools.lasclassify etc. You can see their definition with FME Workbench (add the transformer onto the Canvas, right-click > Edit).


  • Author
  • 7 replies
  • January 20, 2020

Thank you very much!