arcpy.CalculatePolygonMainAngle_cartography("FeatureLayer", "poly_angle")
from the PythonCaller transformer to calculate a polygons main angle. What I can't really understand (as my python skills are absolute nonexisting) is how to wrap than inside the template function interface. I have tried to integrate the arcpy- function like this:
---
import fmeobjects
import arcpy
def angleFeature(feature):
ang = arcpy.CalculatePolygonMainAngle_cartography("FeatureLayer", "angle")
feature.setAttribute("angle", ang)
--
but when trying to run the workbench I get the following error
ERROR 000732: Input Features: Dataset FeatureLayer does not exist or is not supported
so Im stuck with the problem that the function cant find my source (wich is a Geodatabase_SDE reader. It also feels that once I get the features into the function, CalculatePolygonMainAngle will write the angle to the attribute "angle" and then fme will write it once again in feature.setAttribute.
I obviously dont know much python, perhaps someone else knows and might help out?