Sometimes a custom reprojection algorithm that isn't supported by the regular reprojection engine is needed. With the current Python API it is possible to iterate over the feature geometry to recalculate the coordinates, but it can be pretty complex when having to account for all the different geometry types, aggregates, donuts, 2D/3D, arcs etc.
It would be very handy if the Python fmeobjects API could provide for a method (e.g. "performCoordinateFunction") for calling a user-defined function on each coordinate using a callback mechanism.
Example:
def myCoordinateFunction(x, y, z): x = x + 3 y = y - 3 if z > 100: z = z * 2 return x, y, z feature = FMEFeature() feature.addCoordinate(55, 81, 233) feature.performCoordinateFunction(myCoordinateFunction)
After calling the performCoordinateFunction with this sample method the geometry would be situated at (x=58, y=78, z=466). The geometry type and composition should otherwise remain unchanged.