FME Transformers: 2024.2
FME Transformers: 2024.2
Snipper
Shortens linear geometry by cutting off the ends.
Typical Uses
-
Shortening or segmenting linear features
How does it work?
The Snipper receives features with line, arc, path, or non-donut area geometry and shortens them according to a specified Starting and Ending Location along the feature.
The snipping locations can be set in a variety of ways:
-
Exact distance along the feature in ground units
-
Percentage distance along the feature
-
Measures
-
Vertex numbers (indices)
The portion of the geometry between the snipping locations is output. The snipped-off portions at either end are output as Remnants.
Areas with portions snipped become non-closed and are output as lines. Donut areas are not supported.
Z Values
Z values are supported. If the snipping location is a new vertex, the z value is determined by linear interpolation between the input vertices on either side.
When Snipping Mode is Distance (Value) or Distance (Percentage), z values may be used for distance calculation only if Measurement Mode is 3D. Otherwise, distances are determined by x and y coordinates only.
Snip by Distance (Value)
When entering distance values, note that:
-
Zero (0) is the start point of the geometry.
-
Any negative value is interpreted as the end point of the geometry.
-
Any value larger than the total length of the geometry is interpreted as the end point.
-
If the snipping location does not coincide with an existing vertex, a new vertex is added.
Action |
Distance Values |
Result |
---|---|---|
None (Input Feature) |
|
|
Snip out a section of the line. |
|
|
Snip off the end of the line. |
|
|
Snip off the beginning of the line. |
|
|
Snip off an equal amount at both ends. |
|
|
Snip by Distance (Percentage)
When entering percentage values, note that:
-
Zero (0) is the start point of the geometry and 100 is the end point.
-
Any negative value is interpreted as the end point of the geometry.
-
Values greater than 100 are interpreted as the end point of the geometry.
-
If the snipping location does not coincide with an existing vertex, a new vertex is added.
Action |
Percentage Values |
Result |
---|---|---|
None (Input Feature) |
||
Snip out a section of the line. |
||
Snip off the end of the line. |
||
Snip off the beginning of the line. |
Snip by Vertex
When entering vertex indices, note that:
-
Zero (0) is the first vertex of the geometry.
-
-1 is the last vertex of the geometry.
-
Negative numbers represent vertices relative to the last vertex, where -2 is second-to-last, -3 is third-to-last, and so on.
-
Snipping may only performed at existing vertices.
-
Out-of-range index numbers are interpreted as either the first vertex (if less than 0) or last vertex (if larger).
Action |
Indices |
Result |
---|---|---|
None (Input Feature) |
||
Snip out a section of the line. |
||
Snip off the last two segments of the line. |
||
Snip off the first segment of the line. |
Snipping with Measures
When entering measures, note that:
-
Snipping with measures determines snipping locations according to measure values, not vertex coordinates.
-
If the snipping location does not coincide with an existing vertex, a new vertex is added.
-
Out-of-range measure values are interpreted as either the first or last vertex, depending on whether they are less than or greater than the range of measure values on the feature.
Action |
Measures |
Result |
---|---|---|
None (Input Feature with measures) |
||
Snip out a section of the line with Measure (Value). |
||
Snip out a section of the line with Measure (Relative to Start Point). |
Usage Notes
-
The DonutHoleExtractor may be useful for pre-processing areas.
Creating and Modifying Linear Features
These transformers work with lines in a variety of ways.
Line Transformers Comparison
Transformer |
Use this to... |
Transformer Description |
---|---|---|
Create one or more new features with box geometry of a specific size and position (when Geometry Object is Line). |
Creates features using the parameters supplied, and sends them into the workspace for processing. |
|
Create simple lines from lines and/or points. |
Connects sequential point and/or line features to create line or area geometry. |
|
Combine adjoining lines into longer lines or complex paths, with more advanced geometry handling options than the LineBuilder. |
Connects line features that meet at common start or end points to create longer lines or paths. |
|
Combine arcs and lines into longer paths. |
Connects sequential line and/or arc features to create path geometry, preserving input segments. |
|
Convert linear features into areas. |
Converts a linear feature to an area by connecting the end point to the start point. |
|
Extend linear geometry. |
Extends line, arc, or path features at both ends by a specified length. |
|
Chop features into smaller features, breaking them at their existing vertices. |
Chops line, arc, path, or area features into smaller features based on number of vertices or approximate length. |
|
Break a path into its component segments (lines and arcs). |
Splits path geometry into its component line and/or arc segments. |
|
Shorten linear geometry. |
Shortens linear geometry by cutting off the ends. |
|
Intersect lines and areas. |
Performs a line-on-area overlay, either splitting lines where they intersect area boundaries or subdividing areas where split by lines. Attributes may be shared between related lines and areas (spatial join). |
|
Intersect lines and lines. |
Performs a line-on-line overlay in which all input lines are intersected against each other and resultant line features are created and output. Intersection points are turned into point features that can contain the merged list of attributes of the original intersected lines. |
|
Find where points lay on lines. |
Performs a point-on-line overlay. Each input line is split at its closest place to any point within the specified point tolerance, and attributes may be shared between related points and lines (spatial join). |
Configuration
Input Ports
Input
This transformer accepts features with line, path, arc, or non-donut area geometry.
Aggregate features are accepted if Aggregate Handling is Deaggregate.
Output Ports
Output
Portions of the input features between the specified snipping locations.
Remnants
Portions of the input features outside the specified snipping locations.
<Rejected>
Features with geometry other than valid line, path, arc, or area geometry are output via this port.
Areas with donuts will be rejected, as will aggregate features if Aggregate Handling is Reject.
Rejected features will have an fme_rejection_code attribute with one of the following values:
INVALID_PARAMETER_LOCATION
INVALID_GEOMETRY_TYPE
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
General
Aggregate Handling |
Select a method for handling aggregate geometries:
|
||||||||||
Snipping Mode |
Select a method for snipping.
|
Measurement
Measurement Mode |
When Snipping Mode is Distance (Value) or Distance (Percentage), select a method for calculating distances along the feature when z values exist:
|
Distance, Percentage, or Measure Values
Starting Location |
When Snipping Mode is Distance (Value), Distance (Percentage), Measure (Relative to Start Point), or Measure (Value), specify the first snipping point on the feature as a numeric value. |
Ending Location |
When Snipping Mode is Distance (Value), Distance (Percentage), Measure (Relative to Start Point), or Measure (Value), specify the second snipping point on the feature as a numeric value. |
Measure Name
Measure Name |
(Optional) When Snipping Mode is Measure (Relative to Start Point) or Measure (Value), provide the name of the measure to be used. If blank, the default measure is used. |
Indices
Starting Vertex |
When Snipping Mode is Vertex, specify the first snipping point on the feature as a vertex index number. Vertex indices start at zero (0). |
Ending Vertex |
When Snipping Mode is Vertex, specify the second snipping point on the feature as a vertex index number. -1 refers to the final vertex. Negative numbers denote position relative to the last vertex, where -2 is second-to-last, -3 is third-to-last, and so on. |
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 | |
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 Snipper 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.