FME Transformers: 2024.2

Categories
Calculated Values
Rasters
Related Transformers
ExpressionEvaluator
PointCloudExpressionEvaluator
RasterCellValueCalculator
RasterCellValueReplacer
RasterCellValueRounder
RasterConvolver
RasterSingularCellValueCalculator
RasterStatisticsCalculator

RasterExpressionEvaluator

Evaluates expressions on each cell in a raster or pair of rasters, including algebraic operations and conditional statements.

Jump to Configuration

Typical Uses

  • Performing calculations on rasters or pairs of rasters
  • Manipulating images
  • Combining rasters
  • Classifying rasters

How does it work?

The RasterExpressionEvaluator receives raster features and evaluates defined expressions using the cell values, then outputs new raster features with the calculated values.

Input Mode - One or Two Rasters

The transformer has two modes - One Raster and Two Rasters.

One Raster mode provides a single input port -the A port. In this mode, expressions will be evaluated wholly within a single raster.

Two Rasters mode provides two input ports - A and B. In this mode, expressions can use cell values from two rasters of the same dimensions (same number of rows and columns). Position information for georeferenced rasters is not taken into consideration. The number of input raster features may be:

  • If One Raster (A) - one or more A raster, no B rasters.
  • If Two Rasters (A and B) - one A raster, one or more B rasters. The single A input will be paired with each B input.

All bands used in the same expression must have the same Nodata value, or have no Nodata value at all. No band may have a palette.

In Two Raster mode, if an expression references both the A and B input raster features, the output raster will have all the attributes from both feature A and B. If the same attribute exists on both input features, then the attribute value from feature B will be preferred.

When only a single input is being operated on (for example, in One Raster mode or if the expression only references input A), the feature attributes and raster properties will remain unchanged.

Expressions

Expressions are defined in the Band Expression(s) table. Each line in the table corresponds to one band in the output raster, in sequential order - that is, the first line produces Band 0, second line produces Band 1, and so forth. The Interpretation Type for each output band is also specified here.

Expressions may be as simple a constant value or simple arithmetic operation. The Arithmetic Editor - Raster Expression is available via the Expression ellipsis (...) button to assist in the construction of expressions.

Expressions are case-sensitive.

Note that when converting between different data types, a Bounded Cast is used. As a result, when a calculated value does not fit in the specified destination interpretation, the corresponding destination value will either be set to the minimum or maximum value possible in the destination data type. For example, a value of 300, if converted to an unsigned 8-bit integer band, would become 255 (the maximum available value for that interpretation type).

Nodata and Zero (0) Values: Expression evaluation often involves changing interpretation types of values, and can sometimes result in unpredictable behavior particularly in the case of zero (0). When defining your expression, best practice is to specify zero in decimal form as 0.0 to avoid it being misinterpreted as Nodata.

Examples

Usage Notes

Choosing a Raster Transformer

FME has an extensive selection of transformers for working with raster data. They can be generally categorized as working with whole rasters, bands, cells or palettes, and those designed for workflow control or combining raster with vector data.

For information on raster geometry and properties, see Rasters (IFMERaster).

Configuration

Input Ports

Output Ports

Parameters

Editing Transformer Parameters

Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.

For more information, see Transformer Parameter Menu Options.

Reference

Processing Behavior

Group-Based

Feature Holding

Yes

Dependencies None
Aliases  
History  

FME Community

The FME Community has a wealth of FME knowledge with over 20,000 active members worldwide. Get help with FME, share knowledge, and connect with users globally.

Search for all results about the RasterExpressionEvaluator on the FME Community.

 

Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.