Skip to main content
Solved

Neighbourfinder - One to one Relationship


galigis
Enthusiast
Forum|alt.badge.img+16

Dear All,

I am attempting to spatially join the nearest points based on a one-to-one relationship but cannot get it to work. Below is a graphical example of my query:

I aim to join the closest yellow dot (627 records) to the nearest black dot (71,533 records). Essentially, I want the Neighbourfinder to identify the closest one-to-one relationship and disregard the others. The default settings of the transformer calculate the nearest points for all 71,533 records, which I wish to avoid. My objective is to integrate the information from the yellow dots into the black dots for only the 627 closest records.

 

Any ideas? 

Thanks :)

Best answer by takashi

Hi ​@galigis ,

Another thought.

  1. Send the yellow points to Base port, send the black points to Candidate port of the NeighborFinder.
    • Number of Neighbors to Find: 1
    • Merge Attributes: [check]
    • Acuumulation Mode: Merge Candidate (or "Replace with Single Candidate" if it's not necessary to keep attributes of yellow point)
  2. On MachedBase features, replace coordinates with x, y of the closest candidate (i.e. black point) using VertexCreator.
    • Mode: Replace with Point
    • X Value: _closest_candidate_x
    • Y Value: _closest_candidate_y 
View original
Did this help you find an answer to your question?

5 replies

geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • April 10, 2025

Something like this?

Note that one black point may be closest to several yellow points.


galigis
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • April 10, 2025

Thanks ​@geomancer but I need it the other way around. the base need to be the 71,533 records and the candidate the 627 in order to bring the closest yellow info into the nearest black points. 

I’m trying to follow this post but can’t get it to work: 

 


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • April 10, 2025

You can join the results to the black points (provided the black points have some unique ID).

 


takashi
Influencer
  • Best Answer
  • April 10, 2025

Hi ​@galigis ,

Another thought.

  1. Send the yellow points to Base port, send the black points to Candidate port of the NeighborFinder.
    • Number of Neighbors to Find: 1
    • Merge Attributes: [check]
    • Acuumulation Mode: Merge Candidate (or "Replace with Single Candidate" if it's not necessary to keep attributes of yellow point)
  2. On MachedBase features, replace coordinates with x, y of the closest candidate (i.e. black point) using VertexCreator.
    • Mode: Replace with Point
    • X Value: _closest_candidate_x
    • Y Value: _closest_candidate_y 

galigis
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • April 10, 2025

Brilliant ​@geomancer and ​@takashi . Both solutions worked perfectly! :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings