FME Transformers: 2024.2
FME Transformers: 2024.2
NeighborPairFinder
Finds the closest two Candidate features within some maximum distance of each Base feature and some minimum separation in heading between the Candidates and the Base.
If no, or only one, Candidate feature is found to be within the maximum distance, then the Base feature will be output unchanged via the UnmatchedBase port.
If two Candidates are found, then the Base feature is output via the MatchedBase port. In this case, the following attributes will be added to the Base feature:
- _distance1, _distance2 – The distance (in ground units) from the Base to the matching Candidate
- _heading1, _heading2 – The angle between the closest interpolated Base point and the closest interpolated Candidate point.
- _closest_base_x1, _closest_base_y1, _closest_base_x2, _closest_base_y2 – The coordinates of the closest interpolated point on the Base feature to the closest interpolated point on the Candidate feature.
- _closest_candidate_x1, _closest_candidate_y1, _closest_candidate_x2, _closest_candidate_y2 – The coordinates of the closest interpolated point on the Candidate feature to the closest interpolated point on the Base feature.
- _candidate_angle1, _candidate_angle2 – The angle from the closest interpolated point on the Candidate feature to the next vertex within the Candidate feature. (If the closest interpolated point on the Candidate feature is its last vertex, then candidate_angle will contain the angle from the previous vertex of the candidate feature to the closest interpolated point on the Candidate feature.)
- _candidate_label_angle1, _candidate_label_angle2 – The _candidate_angle adjusted so that if it is used as a text rotation, the text will run from left to right. This angle is guaranteed to be greater than or equal to 270 and less than 360, or greater than or equal to 0 and less than or equal to 90.
(The attributes ending in 1 relate to the closest Candidate feature found. The attributes ending in 2 relate to the next closest Candidate feature found, which has a sufficiently different heading.)
All headings are measured in degrees counterclockwise from horizontal. All distances are measured in the ground units of the features.
The ClosestVector and SecondClosestVector ports will have linear features output on them that connect the closest points on the base and candidate features. These ports are useful only for visualizing where the closest points were found.
Invalid features (such as extra candidates) are output via the <Rejected> port. Base and candidate features with null geometries will be rejected.
Rejected features will have an fme_rejection_code attribute with one of the following values: EXTRA_CANDIDATE_FEATURE, INVALID_BASE_GEOMETRY_VERTICES, INVALID_CANDIDATE_GEOMETRY_VERTICES, INVALID_GEOMETRY_VERTICES.
Configuration
Parameters
Transformer Mode
Input |
Bases and Candidates - Accepts both Base and Candidate features (default). If a feature is routed to both the Base and the Candidate input ports, then features will be compared to themselves as they are both a Base and Candidate. Candidates Only - Accept only Candidate features. There will be no Base input port. All Candidates will be compared with all other Candidates, but will not be compared to themselves. |
General
Maximum Distance |
Specify the maximum distance from each Base feature within which to find the closest two Candidate features. The maximum distance is measured in the units of coordinates of the input features. |
Minimum Separation Angle |
Minimum separation angle is measured in degrees, and specifies the minimum difference in heading from the base that the two candidates must have before the second one will be used. |
Candidate Key Attribute |
Used to select a Candidate attribute from the two closest Candidates that will be preserved on the Base feature as _key attributes. |
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.
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 NeighborPairFinder on the FME Community.
Keywords: NeighbourPairFinder