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.



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.

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

Dialog Options - Tables

Transformers with table-style parameters have additional tools for populating and manipulating values.

FME Community

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 samples and information about this transformer on the FME Community.

Keywords: NeighbourPairFinder