Hi,
I would simply need to integrate rasterio's python function for raster sieving into FME Workbench's PythonCaller transformer. Indeed there is no native raster sieving function in FME.
As I'm not familiar with Python I quickly read through this article but examples there do not apply to raster specifically.
Due to my ignorance of Python scripting I am not sure from a syntax point of view how to make the reference to the raster and its bands (if required).
Basically my purpose is to eliminate polygons which have a number of cells equal or less than 4.
Which essential code lines would be required around the following?:
import fme
import fmeobjects
import rasterio
def rasterioSieving(feature):
rasterio.features.sieve(source, 5, out=None, mask=None, connectivity=8)
Actually if you have an example workspace with Python code acting on a raster for any operation, then I would also be interested. As I'm more curious to how the raster is actually being referred to inside the Python script for a very straight-forward operation.
Thanks in advance!
Olivier