- Performing calculations on individual point values within a point cloud
- Updating point cloud component values
- Adding new point cloud components
How does it work?
The PointCloudExpressionEvaluator receives point cloud features and evaluates defined expressions using the individual points’ component values, then outputs a point cloud feature with the calculated values applied to existing or new components.
Expressions are defined in the right-hand column of the Component Expression(s) table. Each line in the table corresponds to one component, which may be new or existing. Component names may be selected from a list of standard components, or user-specified.
The Data Type for each component is also specified here, and may be set to automatically determine the appropriate type, or to preserve the type of an existing component. Strings are not supported.
Expressions may be as simple a constant value or simple arithmetic operation. The Arithmetic Editor is available via the Expression ellipsis (...) button to assist in the construction of expressions. Point cloud components are available in the editor.
Expressions are case-sensitive.
An expression consists of a combination of operands, operators, and parentheses.
White space may be used between the operands, operators, and parentheses as it is ignored by the expression processor.
See Math Operators for a complete list and documentation.
Operands may be any of the following:
A component from an input point cloud.
Note that if a component has a scale/offset, the "applied" value of the component will be used in the expression.
A numeric constant, either integer or floating-point.
Where possible, numeric constants are interpreted as integer values; otherwise, operands will be treated as floating-point numbers.
|The value of an attribute, using @Value() notation.
@if(@Component(z) < 0,0,@Component(z))
A function whose arguments have any of the above forms for operands. Available functions include:
Note See Math Functions for a complete list of FME math functions and documentation. Not all functions are available in all contexts.
Private or Published Parameter
|Published and private parameters, including user parameters. See Creating and Modifying User Parameters.
Types and Overflows
This transformer attempts to avoid overflows by changing data types through the course of evaluating an expression. For example, if two UInt8 values are added together, the internal computations will be performed with a UInt16 type; this ensures that no overflow will occur.
In general, performing an arithmetic operation on integer types will produce an integer type. The exception to this is division: it will always produce a floating-point result. Performing an arithmetic operation on floating-point types will always produce a floating-point type.
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 data type, 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 component (UInt8), would become 255 (the maximum available value for that data type).
In this example, we will calculate above-ground-level (AGL) heights for a LiDAR point cloud, located on the coast, near sea level, with many tall buildings.
Note that the source feature, viewed here in the FME Data Inspector from an oblique angle in 3D, has a z component representing the elevation of the point - which is not necessarily the elevation of the ground. Points are returned above the ground when they encounter structures and vegetation.
We will overlay the point cloud on a DEM elevation raster in order to extract the ground elevations. Note that the elevations are stored in Band 0 of this single-band raster. Both datasets are in the same coordinate system and units.
The operation will take two steps. First, both the point cloud and DEM raster are routed into a PointCloudOnRasterComponentSetter to extract the ground elevations. Then the resulting point cloud feature is sent on to the PointCloudExpressionEvaluator to calculate the AGL heights.
Step 1 - Extracting Ground Elevations
In the parameters dialog of the PointCloudOnRasterComponentSetter, we set Components to Set to Custom.
The custom component is defined in the Components table, extracting values from Band 0 to a new component named Elevation. The Default Value is set to 0.
Note that the output point cloud feature has a new component - Elevation. The selected point shown here has a z value of about 97.57 meters -but the ground elevation at that location is only about 4.985 meters.
Step 2 - Calculating Height
In the parameters dialog of the PointCloudExpressionEvaluator a new Component is defined, named AGL. The Data Type is set to Auto, and an expression is constructed that subtracts the ground elevation from the point elevation.
The output point cloud feature has a new AGL component with the results of the expression evaluation.
The point selected here has a z value of 95.37 meters. Subtracting the ground elevation produces a height above ground of about 89.88 meters.
- This transformer does not support strings. To add string components, use the PointCloudComponentAdder.
- This transformer can be used to set an existing component to a constant value by setting the expression to the desired constant.
- The arithmetic editor is available from the ellipsis (...) button to assist in constructing expressions. See Arithmetic Editor for full documentation.
Choosing a Point Cloud Transformer
FME has a selection of transformers for working specifically with point cloud data.
For information on point cloud geometry and properties, see Point Clouds (IFMEPointCloud).
Combines features into a single point cloud. Point cloud and non-point cloud geometries are supported.
Adds new components with constant values to a point cloud.
Copies selected component values onto either a new or existing component
Keeps only specified point cloud components, discarding all others.
Removes specified components from a point cloud.
Renames an existing component.
Alters the data type of point cloud components, and converts component values if required.
Reads point cloud features for testing purposes, including any accumulated point cloud operations. No additional operations are performed, and nothing is done with the features.
Creates a point cloud of specified size and density, with default component values.
Evaluates expressions on each point in a point cloud feature, including algebraic operations and conditional statements, and sets individual point cloud component values.
Serializes the geometry of a point cloud feature into a Blob attribute, encoding the contents according to a choice of common binary point cloud formats.
Separates point clouds into multiple features, based on evaluating expressions including component values, and creates a separate output port for each expression defined.
Merges point clouds by joining points where selected component values match (join key), including x, y, z, and other components. Component values are transferred between point clouds and output is filtered based on matching success and duplication.
Sets point cloud component values by overlaying a point cloud on a raster. The component values for each point are interpolated from band values at the point location.
Extracts the geometry properties of a point cloud feature and exposes them as attributes, optionally checking for their existence, retrieving component properties, and finding minimum and maximum values. Extents may also be recalculated and updated.
Decodes a binary attribute containing encoded point clouds stored as Blobs, replacing the feature’s geometry with the decoded point cloud.
Reduces the number of points in a point cloud by selectively keeping points based on the shape of the point cloud. The simplified and removed points are output as two discrete point clouds.
Sorts the points within a point cloud by one or more component values.
Separates point clouds into multiple features based on component values, color, or first/last return.
Calculates statistics on point cloud components and adds the results as attributes.
Takes an input point cloud and reconstructs it into an output mesh.
Reduces the number of points in (thins) a point cloud by keeping points at a fixed interval, a maximum number of points, or a set quantity of first or last points. Remaining points are discarded.
Converts point clouds to point or multipoint geometries, optionally retaining attribute and component values.
Applies a point cloud’s scale, offset, or transformation matrix to it, recalculating component values and removing the transformation values.
This transformer accepts only point cloud features.
Point Cloud features with new or updated component values as specified in the parameters.
Non-point cloud features will be routed to the <Rejected> port, as well as invalid point clouds.
Rejected features will have an fme_rejection_code attribute with one of the following values:
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.
Specifies the component to be set by the corresponding expression. Standard component names may be selected from the drop-down menu. Custom user component names may be entered directly.
Components may be either existing or new, and will either be updated or created, respectively.
Select the type of the component in the output point cloud. Choices include:
Define an expression to be evaluated. The Arithmetic Editor may be accessed via the ellipsis (...) button to assist in creating expressions.
The result of this expression will be stored in the corresponding component on the output point cloud.
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.
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Set values depending on one or more test conditions that either pass or fail.
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
|These functions manipulate and format strings.
|A set of control characters is available in the Text Editor.
|Math functions are available in both editors.
|Date and time functions are available in the Text Editor.
|These operators are available in the Arithmetic Editor.
|These return primarily feature-specific values.
|FME and workspace-specific parameters may be used.
|Creating and Modifying User Parameters
|Create your own editable parameters.
Dialog Options - Tables
Transformers with table-style parameters have additional tools for populating and manipulating values.
Enabled once you have clicked on a row item. Choices include:
Cut, Copy, and Paste
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers.
|Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output.
|Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers.
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers.
Note: Not all tools are available in all transformers.
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for all results about the PointCloudExpressionEvaluator on the FME Community.
Examples may contain information licensed under the Open Government Licence – Vancouver and/or the Open Government Licence – Canada.
Keywords: point "point cloud" cloud PointCloud LiDAR sonar