FME Transformers: 2024.2
FME Transformers: 2024.2
HullReplacer
Replaces feature geometry with a convex or concave hull around the feature.
Typical Uses
-
Generating hulls around individual features
How does it work?
The HullReplacer receives features with any geometry type and individually replaces their geometry either a Convex or Concave hull.
A convex hull is a polygon covering the extents of the feature, where no interior angle is greater than 180 degrees. It resembles an elastic band surrounding the feature.
A concave hull (or alpha hull) has no restrictions on angle and may follow the general shape of the feature more tightly. It is calculated using the Alpha Value parameter and can have multiple parts and donuts.
If an output hull has zero area (the hull of a single point or vertical line, for example), it will become a point or line as appropriate.
3D hulls may be generated when input features are either 3D or a mix of 3D and 2D. If mixed, 2D features are assigned a default Z value.
Concave hulls and alpha values
Concave hulls vary in shape. They are calculated by first triangulating the dataset, then measuring the circumradius of the resulting triangles (the radius of a circle that touches all three points of the triangle). Triangles that are larger than the specified Alpha Value are discarded, and the rest are dissolved to form the hull. Measurements are in ground units.
If the Alpha Value is explicitly specified, it is used for the calculation. If it is zero (0) or not specified, the alpha is approximated as the smallest value that produces a single area. If the alpha is too small it may return a null geometry. Larger numbers generally produce larger areas, and a large enough alpha value produces the same result as a convex hull.
See Examples below to see the effect of varying the Alpha Value.
Geometries that are farther away than Alpha Value from the rest of the geometries may be discarded if they do not constitute a valid area on their own.
Concave hull generation works best with points, but line and area geometries will be accepted and converted to points if input.
Examples
Example: Replacing a multi-point feature’s geometry with its hull
In this example, we want to generate both convex and concave hulls around a point cloud. Note that the bottom left corner of the data has an irregular edge, the result of LiDAR coverage along a coastline.
A point cloud is a single feature. There is a set of specialized point cloud transformers that operate on individual points, but other transformers generally treat their geometry as their rectangular footprint (bounding box).
To create a hull that honors the irregular edge, the point cloud is first routed into a PointCloudToPointCoercer and then on to a HullReplacer.
In the parameters dialog, Output Geometry is set to Single Multipoint. Only one feature is output via the Coerced output port.
The resulting multipoint feature is no longer treated as a point cloud. Note that this will result in much longer processing times.
In the parameters dialog of the HullReplacer, Hull Type is set to Convex (), and Output Dimension is changed from Automatic to 2D to ensure the hull is a footprint.
The resulting 2D hull honors the irregular boundary of the data. It replaces the multipoint geometry.
If Hull Type is Concave )( and Alpha Value is left blank (calculating the optimal alpha to produce a single hull), a tightly fitting hull is produced. Processing time is much longer.
Example: Concave hulls and alpha values
In this example, we will generate a series of concave hulls for a set of property addresses while varying alpha values.
The input features are in a UTM83-10 coordinate system, with ground units in meters, and so the alpha value represents a measurement in meters as well.
Alpha Value |
Concave Hull |
---|---|
10 - Too small for useful results. |
|
50 - Tightly fitting, some input points fall outside alpha distance. |
|
Default (blank) - optimal value calculated to produce a single area. |
|
500 - Loosely fitting but not convex. |
|
10000 - Identical to the convex hull. |
Usage Notes
- Point clouds are considered single features. To create a hull from a point cloud’s individual points, use a PointCloudToPointCoercer beforehand, setting the Output Geometry parameter to either Single Multipoint or Individual Points.
-
For triangulated surfaces, see the SurfaceModeller, Triangles output.
Configuration
Input Ports
Input
Features with 2D and/or 3D geometry.
Arcs and ellipses will be stroked prior to the calculation of the hull. Text features will be treated as points.
Output Ports
Hull
Hull geometry as specified in parameters. Typically a polygon, but possibly a line or a point.
<Rejected>
Features without valid geometry are output via this port, as are features with non-numeric values for Alpha or Default Z Value.
Rejected features will have an fme_rejection_code attribute with one of the following values:
INVALID_GEOMETRY_VERTICES
INVALID_PARAMETER_ALPHA_VALUE
INVALID_PARAMETER_DEFAULT_Z_VALUE.
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
Hull
Hull Type |
Select the hull type to be calculated:
|
Alpha Value |
When Hull Type is Concave)(, either:
See Examples above for alpha value usage. |
Output Dimension
Output |
Select the dimensionality of the output hull:
|
||||||
Default Z Value |
When Output is 3D, provide a Z value to assign to converted 2D features. |
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.
How to Set Parameter Values
Defining Values
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.
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.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
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.
Content Types
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | 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
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
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. |
Filter
|
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
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
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.
For more information, see Transformer Parameter Menu Options.
Reference
Processing Behavior |
|
Feature Holding |
No |
Dependencies | None |
Aliases | ConvexHullCreator |
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 HullReplacer 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.