Skip to main content
  • 10000+ Posts
  • 53,364 Replies
10000+ Posts
How to create geometries with a python caller?

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 fmeimport fmeobjectsclass 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  

Badge Winners

  • Integrate Data with the FME Platform Training
    blair.harrishas earned the badge Integrate Data with the FME Platform Training
  • FME Form Advanced Training
    miquelrshas earned the badge FME Form Advanced Training
  • Webinar Watcher (Grey)
    vincentlihas earned the badge Webinar Watcher (Grey)
  • Expert (Grey)
    kylewickshas earned the badge Expert (Grey)
  • Online Training
    wiltonpolescahas earned the badge Online Training
Show all badges

Community Stats

32,412
Posts
123,192
Replies
40,522
Members