Hi,
A simple question:
Is the index range in an FMEObjects FMEAggregate geometry parts list 0-based or 1-based ?
The documentation doesn't say anything about this either way.
It's for code in a PythonCaller.
Cheers
Lars I.
Hi,
A simple question:
Is the index range in an FMEObjects FMEAggregate geometry parts list 0-based or 1-based ?
The documentation doesn't say anything about this either way.
It's for code in a PythonCaller.
Cheers
Lars I.
Best answer by takashi
Hi @lifalin2016, you can check it yourself. e.g.
# PythonCaller Script Example
# Check whether part index of FMEAggregate is 0-based or 1-based.
import fme
import fmeobjects
class FeatureProcessor(object):
def __init__(self):
self.logger = fmeobjects.FMELogFile()
def input(self,feature):
geom = feature.getGeometry()
if not isinstance(geom, fmeobjects.FMEAggregate):
self.logger.logMessageString('NOT Aggregate', fmeobjects.FME_WARN)
elif geom.getPartAt(0) != None:
self.logger.logMessageString('0-based', fmeobjects.FME_WARN)
elif geom.getPartAt(geom.numParts()) != None:
self.logger.logMessageString('1-based', fmeobjects.FME_WARN)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.