RasterInterpretationCoercer
Alters the underlying interpretation of the bands of the raster geometry on the input features, using the specified conversion options.
For example, an input raster feature with three bands of interpretation (UInt16, Gray8, and Real64) could be converted to a raster feature with three bands of interpretation (Red8, Green8, and Blue8) or four bands of interpretation (Red16, Green16, Blue16, and Alpha16) in a single operation.
Parameters
Interpretation
This parameter selects the destination interpretation along with the bit depth. Different interpretations allow for different conversion options to be used. If any bands on the raster contain palettes, then the destination interpretation is restricted to UInt8, UInt16 or UInt32.
Conversion Options
When converting to an interpretation with multiple components, such as RGB and RGBA, the raster will be expected to have exactly 1, 3, or 4 bands. If only one band is supplied, it will be cloned and converted to the appropriate interpretation. When converting to a single color or numeric interpretation, multiple input bands will be averaged into a single one.
The RGBA to RGB parameter selects the action to perform when converting four bands representing an RGBA raster to three bands representing an RGB raster.
- Drop the alpha band discards the alpha band.
- Apply the alpha band multiplies all RGB values with their corresponding, normalized alpha value.
This parameter selects the action to perform when converting three bands representing an RGB raster to four bands representing an RGBA raster.
- Create opaque alpha band adds a new alpha band which has the maximum value for the data type in all cells.
- Create alpha band from nodata creates a new band which has the maximum value for the data type only in data cells. A cell is considered to be nodata when, for each selected band, the value for that cell is equal to that band's nodata value. If any cell value is not equal to that band's nodata value, the cell will be considered data. Note that when this option is selected, it is required that all input bands have a nodata value.
These parameters select the action to undertake when the given conversion between different types occurs.
- Cast is very efficient and is lossless if the data values are contained within the destination data range. If outside the range, the Cast option allows overflow and rolls over the data values at the min and max of the destination data range, thus all values are contained in the destination range but if they rolled over may not reflect the source values very well.
- Bounded cast improves the basic Cast by also validating that the source values fit into the destination type, effectively preventing underflow and overflow; if a source value does not fit, the corresponding destination value will either be set to the minimum or maximum value possible in the destination data type.
- Scale by data values finds the minimum and maximum values of the source values and uses them to scale the values to the full range of the destination type.
- Scale by data type scales the source data range directly to the destination data range regardless of where the data values lie.
This parameter specifies the action to perform when converting from a floating-point value to an integer.
- Round rounds to floating-point value to the nearest integer.
- Ceiling gets the next integer which is greater than or equal to the floating-point value.
- Floor gets the next integer which is less than or equal to the floating-point value.
Usage Notes
Each RasterInterpretationCoercer performs a conversion on the input raster. If multiple RasterInterpretationCoercers are used in sequence, then multiple conversions will take place; data quality and translation performance may suffer.
This transformer is unaffected by raster band and palette selection.
Example
Related Transformers
- The RasterBandInterpretationCoercer performs similar conversions on individual bands.
- The RasterPaletteInterpretationCoercer performs similar conversions on palettes.
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
FME Licensing Level
FME Professional edition and above
Transformer History
This transformer replaces the RasterDataTypeCoercer and RasterColorModelCoercer transformers.
Technical History
Associated FME function or factory: @ReinterpretRaster
Search FME Community
Search for samples and information about this transformer on the FME Community.