I have a very large and complex Python/arcpy script that does lots of custom calculations, and I am trying to port it to an FME environemnt. The script runs beautifully under ArcGIS. The problem in porting is that some of the ESRI-specific functionality, especially geoprocessing tools, has to be replaced with similar FME functionality. So, I would like to inquire if there is a way to run FME transformers, e.g. HullReplacer, from a PythonCaller script in an FME workspace.

True, the project could be rewritten completely in Workbench. I have no doubt about that; however, that would take a lot of time and effort ... and to be completely honest, I am doing the port to FME for someone else who actually has the FME license. I do not have access to FME myself. Most of the functions of the existing script have ported almost without change to FME Workbench. Works great. There are a few places, though--right smack dab in the middle of the code--where some FME functionality is needed to replace some ESRI functionality, and "there's a transformer for that." If I could execute a transformer in those places and continue processing the existing code with the output of the transformer, I could easily port the rest of the script. I just don't know if it is possible programmatically to execute a transformer from Python. I can't find any direct mention of this in online FME documentation or in online searches. I have noted that a Python wrapper has been created for the IFMELibrary. That provides a promising hint, but frankly I don't know what the IFMELibrary is or what it entails. There is no documentation for it.

Can anyone shed any light on this for me? Thanks, all, for the help.

ADDITION: Hmmm. I see in this post some sample code (in the first block) showing a transformer being called through Python. Is this a valid and supported syntax? If so, is there an online documentation set that covers the Python/fmeobjects syntax for calling each of the transformers?

CONCLUSION: After a lot of searching, testing, and -- finally!-- being able to submit a question to Safe Software, my conclusion is that one cannot call FME transformers from within a Python script in a PythonCaller transformer. This is disappointing. I must proceed with chopping the scripts into little pieces and redoing the whole process in FME Workbench.

  • How are you going to test it without a license? – blah238 Nov 5 '13 at 20:18
  • 1
    @blah238 trial version safe.com/fme/fme-technology/fme-desktop/trial-download – Mapperz Nov 5 '13 at 20:35
  • for FME to access the ArcObjects components in your python code FME and ArcGIS need to be on the same computer (both licensed). – Mapperz Nov 5 '13 at 20:39
  • See Example fmepedia.safe.com/articles/Samples_and_Demos/… – Mapperz Nov 5 '13 at 20:46
  • @blah238 - How do I test it? Not very conveniently ... seriously, what I have to do is send the scripts to my boss, who has FME, and let them create the workspace. They run it while I watch and consult over shared screens on Skype ... yes, a trial version would be good, but my boss is waiting on that until he is closer to getting me a license, too. – celticflute Nov 5 '13 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.