***Note from Migration:***
Original Title was: Enhance FME Server on Linux so PythonCaller scripts can use GDAL / OGR and associated libraries
The PythonCaller transformer provides a powerful way of extending what can be done with FME, when there is no native transformer available. A key set of tools for working with geospatial data in Python are the GDAL libraries and Python bindings. However, at present PythonCaller transformers that use GDAL (or OGR, or various associated libraries) do not work in FME Server on Linux. This means that one of the main uses for the PythonCaller - to extend the capability of FME itself - breaks.
Problem
>>> from osgeo import gdal >>> print gdal.GetDriverCount() 207
Possible Solution
- Customising the FME-internal version of GDAL a bit more so that the functions (symbols) it provides don't conflict with the original GDAL ones. So when the Python GDAL library tries to call the native GDAL functions, it gets the correct system-installed ones, and stuff that's internal to FME stays that way and doesn't "accidentally" get called by a user's code. I don't think that I as a user should be able to have my Python code accidentally call things that are supposed to be internal to the code of FME. (Note, the same issue I'm describing here used to also happen with the SQLite library, which also didn't work in Python code on Server, but that has now been fixed in recent versions of Server which no longer have an FME-specific version of that library. So change is possible here!)
- Increasing the separation of the Python environment that runs within a PythonCaller or PythonCreator. I don't know how or if this could be done. However since on linux FME uses the system Python interpreter, then I think it's reasonable to expect Python code that works at the command line, to also work when called via FME.