I use python caller to get data from json into FME desktop.
Through few steps in Python, I exctract the data that I need and add it to a python dictionary. Basically this dictionary contains pairs of plan numbers (Unique Identifier) & coordinates for polygons (python list).
The last few lines of my code are :
plans_dict = dict()
for each in campuses['campuses'][0]['sitePlanMetadata']['spatialMetadata']['planFootprints']:
# creating dictionary with plancode as key and polygon coordinates as values
plans_dict[each['planCode']] = each['polygons']['coordinates']
Then I tried to output the dictionary to my FME workbench to use the data in the next step, which is create a spatial dataset containing the polygons:
output = plans_dict
feature.setAttribute("output", output)
I get an error:
Python Exception <TypeError>: Could not convert attribute value to a supported attribute type.
Error encountered while calling function `processFeature'
PythonCaller (PythonFactory): PythonFactory failed to process feature
What is the way to output my data from python caller to FME workbench?