Skip to main content
Solved

How to include C++ code into a Workbench?


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).

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • 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
  • January 20, 2020

Thank you very much!


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