I'm trying to find an equivalent in FME to the Majority Filter in ArcGIS (http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/majority-filter.htm), I've had no success this far... Help, anyone?
-
I don't think there is one transformer to do this but a key one is the RasterResampler docs.safe.com/fme/2017.0/html/FME_Desktop_Documentation/… you might need some math in raster expression evaluation before to get the same as majority_definition in ArcGIS. – Mapperz♦ May 8 '17 at 14:01
As @Mapperz said above, FME doesn't have a native transformer (yet) to do that sort of task.
There are a few ways to create the same result though. Check out this blog post and this knowledge centre article about a Game of Life challenge that some of our users tried.
The submission I'd really suggest you look at is Takashi #2. As it mentions in the blog post:
There’s (currently) not an option in the RasterResampler to sum the 8 surrounding squares, so Takashi creates 8 copies of the grid and offsets each left/right/up/down to stack the squares to sum vertically. Then he adds them together with a RasterBandCombiner.
I wouldn't say it's an elegant solution, but it's about as good as you could do right now. He was summing the values. I guess you would need to do that part a little differently - perhaps calculate the mean - but I think that's the way I would start looking at this.
My solution to the same challenge was to drop the raster into a single-cell raster feature for each cell (using the Clipper transformer). Then you can use the NeighborFinder transformer to locate each cell's neighbours and carry out an analysis of them. I think Takashi's version is better!
In short, there's no single FME transformer to do this, but a few potential workarounds if you have the time to investigate them. If you want to see this functionality in FME then please do contact their support team and mention PR#24574