Skip to main content
Solved

NeighborFinder to find distance to nearest polygon

  • December 4, 2025
  • 2 replies
  • 105 views

mapper
Contributor
Forum|alt.badge.img+7

Hello,

 

I have a polygon dataset and I am trying to find the polygons that are within 200m of another polygon. I am trying to do this using the NeighborFinder in candidate only mode with the “Number of Neighbors to Find” = 1 and “Max Distance” = unset and then using a tester to select the features where _distance is less than 200.  I am getting a lot of features out of the “unmatchedcanidate” port though. I would have though with number of features to find = 1 and an unset max distance all candidates would be matched and given a distance to their nearest neighbor? am I missing something?

Best answer by j.botterill

Hi there, 

From the documentation 

Candidate features not within the Maximum Distance to any Base feature are output via the UnmatchedCandidate port. Candidate features in excess of the Number of Neighbors to Find parameter will also be output here (only the first x number of matches will be used). If Generate List is not enabled, then any features within the Maximum Distance, but not closest, will be output from the UnmatchedCandidate port

So try generate list, inspect resulting feature and manipulated the list with this information - see List Attributes.

There are some additional parameters on the NeighborFinder, such as “Treat Polygons As” = lines or points which also might alter the result.

Safe articles Determining Nearest Neighbors – FME Support Center and to learn how to find nearest neighbors with non-point features, such as polygons, see the Find Nearest Features article.

 

2 replies

j.botterill
Influencer
Forum|alt.badge.img+55
  • Influencer
  • Best Answer
  • December 5, 2025

Hi there, 

From the documentation 

Candidate features not within the Maximum Distance to any Base feature are output via the UnmatchedCandidate port. Candidate features in excess of the Number of Neighbors to Find parameter will also be output here (only the first x number of matches will be used). If Generate List is not enabled, then any features within the Maximum Distance, but not closest, will be output from the UnmatchedCandidate port

So try generate list, inspect resulting feature and manipulated the list with this information - see List Attributes.

There are some additional parameters on the NeighborFinder, such as “Treat Polygons As” = lines or points which also might alter the result.

Safe articles Determining Nearest Neighbors – FME Support Center and to learn how to find nearest neighbors with non-point features, such as polygons, see the Find Nearest Features article.

 


mapper
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • December 5, 2025

Checking Generate List worked thanks!