Skip to main content

Hi,

I have what I think is a fairly simple question. I just want to calculate the average of all the cells in one band on a raster. I am using FME2017.0.

Is there a simple way to do this without having to convert the rasters to vectors (points) and then using StatisticsCalculator

Thanks

I'm not sure whether it's actually producing a proper average value but...

If you resample (RasterResampler) it to 1x1 pixel you'll get something that, at least in the trials I've done, appears to be pretty correct. It's also very fast (which I think running statistics on a lot of pixels is not)


Another thought. You can use the PointCloudCombiner to transform it into a point cloud, and then calculate Mean of required component values with the PointCloudStatisticsCalculator.


Great thanks guys, I will try those methods out :)


Another thought. You can use the PointCloudCombiner to transform it into a point cloud, and then calculate Mean of required component values with the PointCloudStatisticsCalculator.

Thanks @takashi this method worked perfectly.

I'm not sure whether it's actually producing a proper average value but...

If you resample (RasterResampler) it to 1x1 pixel you'll get something that, at least in the trials I've done, appears to be pretty correct. It's also very fast (which I think running statistics on a lot of pixels is not)

Thanks @redgeographics

 

This method worked for some of my rasters (but the mean was a centimeter or so different to what was calculated using other methods), but not for all my rasters (some of them resulted in a single cell of No Data).

Reply