The main idea:
I have this combination of transformers that are meant to clip a raster and from the result of that clip extract the values for every point using the RasterCellCoercer. This way I can do some statistics with the values of the raster that fall inside some polygons.
The problem:
I started realizing that the results coming out of the clipper were not consistent. I thought I was losing my mind. Sometimes when I use the clipper using multiple polygons the clipper clips as expected, tight and beautiful (what I need), some other times the clipper clips using the bounding box of every polygon feature that is supposed to be clipping. Also I get way more points, which is a pain bc I am working with big numbers here.
Case 1 (Expected):


Case 2 (The unwanted):


Just for completion here are my Clipper settings:

Think this should not be the expected behaviour of a transformer. It is inconsistent, since the input raster and polygon features are exactly the same. I don’t know it it has something to do with some technical limitation of maybe something about things being cached, but I would like to understand what is happening and find a solution.
Of course I have a found a workaround, which is in the set of transformers I have shown you. At the end I check if the values are 0.
But this is not a good solution for several reasons.
- The clipper still has inconsistent behaviour.
- The amount of points I get approximately double of the needed ones when it fails. This takes a significant time to filter the trash out.
- In case I was using some raster that could have real 0 values, I would not be able to filter the outside points as easily, and I would be forced to use another kind of expensive operation (like clipping again millions of points). I plan on running this with several million points, so that is not a good option.
- I just think FME would be a better place without this solved.
Probably another solution could be to use the RasterStatisticsCalculator, but if the clipper does not work properly I don’t see a clear solution using that.
So if anyone know how to help me, or someone working in FME wants to solve this inconsistency (in case it is and its not me not understanding something) I would really appreciate it.
Thanks in advance for your time.