Hi
I'm using FME WorkBench 2017 and I want to use the pythoncaller to replace the cell values of multiple raster features with list values of an equivalent size.
The input raster features are:
1. different-sized clips of a larger raster
2. in ASCII format,
3. and have a background value of zero.
For each raster, I want to replace raster cell values greater than zero with values from an associated list, where this list is the same size as all the non-zero values of each raster.
I'm new to FME and the python caller, but I would use the following code in a regular python console to perform the task:
my_rasterInumpy.nonzero(my_raster)] = my_list
My confusion lies in correctly using the Template Function and Class Interface so I call the input raster features into the pythoncaller and manipulate them. I am always receiving errors saying that 'my_raster' is being recognised as a string, causing me to think i am not calling it correctly.
Is there also an FME function that has the same functionality as 'numpy.nonzero()'?
Any help is appreciated!!