I was learning Python FME Objects API for Raster, I tried to extract a band to generate a new raster, But it didn't work out. What's wrong with my code?
import fme
import fmeobjects
class ExtractRasterByBand(object):
def __init__(self):
pass
def input(self, feature):
rs=feature.getGeometry()
rp=rs.getProperties()
rb=rs.getBand(0)
newfeature=fmeobjects.FMEFeature()
rsnew=fmeobjects.FMERaster(rp)
rsnew.appendBand(rb)
self.pyoutput(newfeature)
def close(self):
pass