#
SurfaceModeller

Constructs a Delaunay triangulation based on input points and breaklines.

The surface model may be output in a variety of representations, such as a triangulated irregular network (TIN), TIN vertices, triangles, digital elevation model (DEM), and contours. Because the surface model is a Delaunay triangulation, it can also be output as its dual – a Voronoi diagram.

## Input Ports

These input features may be 2D or 3D. Other than points, lines and area geometries, they may also be raster, point cloud, and aggregate geometries.

2D features will be forced to 3D by adding a z value of 0. In most cases, all points extracted from this port will be found in the vertex pool of the underlying surface model. A minimum of 3 unique points are required to construct a surface model. Points with duplicate x and y values will be dropped.

These input features may be 2D or 3D, and may reside inside an aggregate structure.

2D features will be forced to 3D by adding a z value of 0. Breakline edges will be found in the edge pool of the underlying surface model. Sometimes, a breakline edge will be split up to allow an optimal triangulation of the surface model. Points with duplicate x and y values will be dropped.

These input features may be 2D or 3D. If they are 3D, their z values will be overwritten. Features input through this port are output via the DrapedFeatures output port with their z values set to interpolated values on the underlying surface model.

## Output Ports

**Tip:** The parameter *Conflict Resolution* can filter out a subset of input Points/Lines to ensure a well-constructed surface model.

This output port samples the underlying surface model according to the sampling rates specified in Output DEM X Cell Spacing, and Output DEM Y Cell Spacing, and produces a set of evenly spaced 3D points.

This output port samples the underlying surface model according to the sampling rates specified in Output DEM X Cell Spacing, and Output DEM Y Cell Spacing, and produces a single raster feature consisting of evenly spaced 3D points arranged by rows and columns.

This output port produces features input through the DrapeFeatures port, with their z values set to interpolated values on the underlying surface model.

This output port produces all the edges of the underlying surface model. Each edge feature contains the attributes `_vertex1_id`

and `_vertex2_id`

, which identify the vertices to which it is connected.

This output port produces all the triangles of the underlying surface model as polygons. Each output triangle has these attributes:

_vertex1_id _vertex2_id _vertex3_id |
identify the vertices that define the triangle |

_slope | the slope of the plane defined by the triangle, in degrees, relative to the horizontal plane |

_percentageSlope | the slope expressed as ( rise / run ) * 100%, or equivalently tan( _slope ) * 100% |

_aspect | the aspect angle, in degrees, measured by the angle between nx and ny, where nx and ny are are the x and y components of the normal vector of the triangle |

This output port produces a single mesh geometry containing all the triangles of the underlying surface model.

This output port produces all of the vertices of the underlying surface model. Each vertex contains the attribute `_vertex_id`

which uniquely identifies the vertex.

This output port produces a 2D dual of the underlying surface model, which is a 3D Delaunay Triangulation. The dual to a Delaunay Triangulation is called the Voronoi Diagram. The 2D dual is constructed by considering only the x and y dimensions of the 3D Delaunay Triangulation. For each vertex in the Delaunay Triangulation, a 2D Voronoi polygon feature is output, which is closer to the vertex it encloses in the x-y plane than any other vertex in the Delaunay Triangulation. Further, the Voronoi polygon has these attributes:

_vertex_id | identifies the vertices that it encloses |

_elevation | contains the elevation of the enclosed vertex |

## Parameters

### Transformer

This parameter allows groups to be formed by attribute values. Zero or more attributes may be specified.

Input features with the same attribute values are placed into the same group. The transformer then operates independently on each group of input features.

If this parameter is left blank, the transformer will treat the entire set of input features as one group.

Process At End (Blocking): This is the default behavior. Processing will only occur in this transformer once all input is present.

Process When Group Changes (Advanced): This transformer will process input groups in order. Changes of the value of the Group By parameter on the input stream will trigger processing on the currently accumulating group. This may improve overall speed (particularly with multiple, equally-sized groups), but could cause undesired behavior if input groups are not truly ordered.

**Considerations for Using**

*Group By*There are two typical reasons for using **Process When Group Changes (Advanced)** . The first is incoming data that is intended to be processed in groups (and is already so ordered). In this case, the structure dictates Group By usage - not performance considerations.

The second possible reason is potential performance gains.

Performance gains are most likely when the data is already sorted (or read using a SQL ORDER BY statement) since less work is required of FME. If the data needs ordering, it can be sorted in the workspace (though the added processing overhead may negate any gains).

Sorting becomes more difficult according to the number of data streams. Multiple streams of data could be almost impossible to sort into the correct order, since all features matching a **Group By** value need to arrive before any features (of any feature type or dataset) belonging to the next group. In this case, using **Group By** with **Process At End (Blocking)** may be the equivalent and simpler approach.

**Note: **Multiple feature types and features from multiple datasets will not generally naturally occur in the correct order.

As with many scenarios, testing different approaches in your workspace with your data is the only definitive way to identify performance gains.

### Parameters

This parameter is used to determine which input points to add to the surface model as vertices. Specifying a value of 0 turns off vertex filtering.

**Tip:** A larger value will speed up surface model construction. The larger the value, the more input points will be filtered out. For input files with millions – or even billions – of points, it becomes essential to increase this value.

When a positive value for surface tolerance is specified, it works as follows. For each vertex that is being added to the model:

- If the x,y location is outside the 2D convex hull of the existing surface model, it is added to the model.
- If the x,y location is inside the 2D convex hull of the existing surface model:
- The difference between the z value from the existing surface model and the z value of the vertex is calculated.
- This difference is compared to the surface model tolerance.
- The vertex is only added to the surface model if the difference is greater than the surface tolerance; otherwise, the vertex is discarded.

This parameter is used for the output ports DEMPoints and DEMRaster when these output ports exist on the transformer. It is also used if DrapeFeatures are input to the model.

- AUTO: The transformer will calculate each output point automatically. The PLANAR method is used if the output point is within a surface triangle in xy and the CONSTANT method is used otherwise.
- PLANAR: Barycentric interpolation is used to determine the z value for each output point. If an output point is outside the 2D convex hull of the surface model, the output z value will be set to NaN (Not a Number).
- CONSTANT: The z value of each output point is set to the z value of the closest vertex in the underlying model.

### DEM

These parameters specify the x and y sampling intervals for the output DEMPoints.

This parameter is used only when Interpolation Method is set to PLANAR, and it only affects the output port DEMRaster.

All output raster cells that fall outside the underlying surface model’s boundaries will be assigned the value of this parameter.

When this parameter is blank, it is interpreted as NaN (Not a Number).

**Note:** To ensure consistent raster output, it is highly recommended that you do not leave this parameter blank.

### Draped Features

This parameter controls whether input DrapeFeatures will retain its vertex count, or be modified to adhere to the underlying surface model:

- If Drape Method is set to VERTEX, the input feature will be output with the same number of vertices, with z values set on each vertex. The z values are interpolated from the underlying surface model.
- If Drape Method is set to MODEL, the feature will have other vertices added to more closely follow the underlying surface model. For example, if an input DrapeFeature falls outside the underlying surface model, it will gain additional vertices where the DrapeFeature crosses the boundaries of the surface model.

**Note: **Note: In general, MODEL produces more detailed results than VERTEX, but may require significantly more processing time to generate draped features.

This parameter controls whether input DrapeFeatures with Z values will be offset or have Z values replaced:

- If Existing Elevation is set to ‘Replace Z’, the input feature will be output with Z values that are interpolated from the underlying surface model.
- If Existing Elevation is set to ‘Offset Z’ and the input feature had Z values, each Z value will be offset by the interpolated Z value from the underlying surface model. For example, if the surface model represents the difference between two elevation models, this mode will allow vector features to be updated accordingly.

### Output Contours

Activating this group causes contour features to be output from the Contours port. Note that when this group is activated, input points along contour intervals will be perturbed or removed (depending on the Conflict Resolution parameter) which may affect output from ports other than the Contours port.

This parameter specifies the elevation separation of the output contours.

This parameter specifies whether the output contours are 2D or 3D. 2D contours are equivalent to 3D contours, except that the z coordinates are dropped.

**Tip:** When the input dataset is large enough, setting this parameter to 2D will result in a visible performance improvement.

This parameter controls whether input points on the contour interval are dropped, or perturbed. Not dropping or perturbing these points would result in topologically invalid contours.

- Perturb Input Points on Contour Interval: Contours are negatively offset in the z direction. The perturbation amount is 1% of the contour interval.
- Remove Input Points on Contour Interval: Input points on the contour interval are not added to the underlying surface model.

### Use Surface Model File

This parameter allows you to define a file for storing a surface model.

File storage is useful for building a large surface model through multiple runs, and for workspaces that need to re-use a preconstructed surface model. The saved surface models can be used as part of a production stream on the same operating system.

**Note:** This parameter is processed only if Group By is not specified.

This parameter specifies the filename, including its path, of the surface model file. The surface model file has the file extension `*.fsm`

.

This parameter controls whether the workspace is reading or writing a surface model file.

**Note: **There must be at least one input feature. For reading, it suffices to input a single feature with a null geometry via any of the input ports.

- Read or Append: Reads the surface model from the specified file, and appends it to the surface model constructed by the input features. The appended model is then written back to the same file.
- Write or Overwrite: Writes the constructed surface model to the specified file. If the specified file exists, it will be overwritten.

This parameter provides an estimate of the number of vertices in the final surface model, which can be significantly greater than the total number of input points through Points/Lines and Breaklines.

**Note:** A generous estimate is recommended when you are building a large model in multiple runs because this estimate is used for optimization purposes. If this estimate is too low, the surface model construction could take significantly longer.

This parameter should only be used when you are building large surface models across multiple runs.

**Note: **In subsequent runs of the SurfaceModeller, this parameter must be specified; otherwise, the transformer will use the bounding box of the surface model from the first run for constructing the surface model.

## Example

## Usage Notes

It is important to note that if the only thing you want to do with an existing surface model is output information, then you must route a feature into the surface model. The easiest way to do this is to simply use the Creator transformer and route a single feature with a null geometry into the DrapeFeatures input port.

## 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

## Technical History

Associated FME function or factory: SurfaceModelFactory

## Search FME Community

Search for samples and information about this transformer on the FME Community.

**Tags **Keywords: MBR "minimum bounding rectangle" SurfaceGeneralizer pointcloud