RasterStatisticsCalculator
Calculates statistics on raster bands and exposes them as attributes. Bands with palettes are valid.
Statistics are calculated and output on each raster feature individually. If you want to calculate raster statistics on a group of rasters in aggregate, merge them prior to this transformer with the RasterBandCombiner or RasterMosaicker.
Statistics will be stored as attributes on the feature. Attributes will be named <band>.<statistic> for stats calculated on band cell values, or <band>.<palette>.<statistic> for stats calculated on resolved palette values. <statistic> will be one of the following: min, max, range, mean, stdev, sum, median, mode.
For example, if Band was chosen and median was calculated for the band at index 0, then an attribute named band0.median would be added to the feature. If Band and Palette was chosen, band 1 has one palette, and max was calculated, then attributes named band1.palette{0}.max and band1.max will be added to the feature.
Input Ports
This transformer accepts only raster features.
Output Ports
Features with the calculated statistics are output through this port.
Non-raster features are output through this port.
Rejected Feature Handling: can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a default FME option and as a workspace parameter.
Parameters
Options
Specifies for all bands chosen: whether to calculate statistics on band values, resolved palette values, or both. If Band is selected and a band with palette(s) is encountered, statistics will be calculated on the band’s cell values. If Palette is selected and a band with no palette is encountered, no statistics will be calculated for that band. If Band and Palette is selected, statistics will be calculated for bands without palettes, bands with palettes will calculate resolved palette values and cell values.
Statistics to Calculate
Specifies which statistics to calculate for each band. Bands are selected by their index starting at 0.
The following statistics may be calculated:
Statistic |
Description |
---|---|
Minimum | The numerical minimum for numeric values, or the lexical minimum for string values. |
Maximum | The numerical maximum for numeric values, or the lexical maximum for string values. |
Mean | The average value, calculated as the sum of values divided by the number of cells. Undefined for string values. |
Sum | The sum of all values. Undefined for string values. |
Range | The maximum minus the minimum. Undefined for string values. |
Standard Deviation | The standard deviation as measured by the "nonbiased" or "n-1" method. Undefined for string values. |
Median | The middle value when the values are listed in order if the number of cells is odd, or the average of the two middle values if the number of cells is even. For string values, the first middle value is always used. |
Mode | The most frequent of all the values. If the dataset is bimodal (two or more values occur with the highest frequency) one of the values will be returned randomly. |
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.