Hi @danilo_inovacao, according to the API doc, constructor of the FMERasterProperties class requires multiple arguments, but you have passed no arguments to the constructor when creating a new instance of the class. It's the direct reason for the error.
If you intend to get the number of columns of the input raster, you can use an FMERasterProperties instance which is returned from the FMERaster.getProperties() method. e.g.
import fme
import fmeobjects
class FMERasterProperties(object):
def __init__(self):
pass
def input(self, feature):
raster = feature.getGeometry()
if isinstance(raster, fmeobjects.FMERaster):
properties = raster.getProperties()
feature.setAttribute('_num_columns', properties.getNumCols())
else:
feature.setAttribute('_error', 'The geometry is not Raster.')
self.pyoutput(feature)
def close(self):
pass
Although the API documentation has not been published on the Knowledge Center yet, you can find the doc with this path in your machine if you selected the option for installing SDK when installing FME 2017.0.
<FME 2017 HOME>/fmeobjects/python/apidoc/index.html
Hi @danilo_inovacao, according to the API doc, constructor of the FMERasterProperties class requires multiple arguments, but you have passed no arguments to the constructor when creating a new instance of the class. It's the direct reason for the error.
If you intend to get the number of columns of the input raster, you can use an FMERasterProperties instance which is returned from the FMERaster.getProperties() method. e.g.
import fme
import fmeobjects
class FMERasterProperties(object):
def __init__(self):
pass
def input(self, feature):
raster = feature.getGeometry()
if isinstance(raster, fmeobjects.FMERaster):
properties = raster.getProperties()
feature.setAttribute('_num_columns', properties.getNumCols())
else:
feature.setAttribute('_error', 'The geometry is not Raster.')
self.pyoutput(feature)
def close(self):
pass
Although the API documentation has not been published on the Knowledge Center yet, you can find the doc with this path in your machine if you selected the option for installing SDK when installing FME 2017.0.
<FME 2017 HOME>/fmeobjects/python/apidoc/index.html
Thanks @takashi your excellent explanation about this code. :)