how rename feature attribute with python
how rename feature attribute with python
Best answer by takashi
Hi @charry, there are at least two ways.
1. Create new attribute, remove old attribute.
def renameExample(feature):
v = feature.getAttribute('oldName')
feature.setAttribute('newName', v)
feature.removeAttribute('oldName')
2. Rename attribute using the FME function @RenameAttributes
def renameExample2(feature):
feature.performFunction('@RenameAttributes(newName,oldName)')
See here to learn more about FME Functions: FME Factory and Function Documentation
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.