Skip to main content
Question

Get all attributes from feature in PythonCaller

  • April 21, 2022
  • 1 reply
  • 324 views

I would like to have a python caller execute a task on every attribute of a feature. How can I do this ?

1 reply

david_r
Celebrity
  • April 21, 2022

Try something like

for attribute_name in feature.getAllAttributeNames():
    attribute_value = feature.getAttribute(attribute_name)
    print('{} = {}'.format(attribute_name, attribute_value))

See also https://docs.safe.com/fme/html/fmepython/api/fmeobjects/_feature/fmeobjects.FMEFeature.getAllAttributeNames.html#fmeobjects.FMEFeature.getAllAttributeNames


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings