Hello,
How can I replace a line with its corresponding points with a python caller?
I tried the following code but it is not working.
import fme
import fmeobjects
class pointCreate(object):
def __init__(self):
pass
def input(self,feature):
if feature.hasGeometry():
coord = feature.getAllCoordinates()
cpt = len(coord)
#coordSys = feature.getCoordSys()
for cpt in range(0,len(coord)):
feature.setAttribute('X_e', coord[cpt][0])
feature.setAttribute('Y_e', coord[cpt][1])
feature.setGeometry(fmeobjects.FMEPoint([float(coord[cpt][0]), float(coord[cpt][1])]))
#feature.setCoordSys(coordSys)
self.pyoutput(feature)
def close(self):
pass
Any ideas,
Thanks