Skip to main content
Question

NeighborFinder and excluding candidates after matched

  • December 8, 2017
  • 9 replies
  • 190 views

Forum|alt.badge.img

Hello!

I am using NeighborFinder to match points from two different datasets. Once a point has been matched I would like to exclude it from the candidates. How would I do this?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

9 replies

takashi
Celebrity
  • 7842 replies
  • December 8, 2017

Hi @lojs, couldn't you use the features output from the UnmatchedCandidate port?


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2076 replies
  • December 8, 2017

Hi @lojs,

If you use the output port Unmatched Candidates from transformer Neighborfinder:

Thanks,

Danilo

 


Forum|alt.badge.img
  • Author
  • 5 replies
  • December 8, 2017

Hi! I don't think so as I would like to match a point only once from the candidates, then it is "used up", I don't want to have a point in the candidates matched by more than one basepoint.

I hope this made my question a bit clearer.


Forum|alt.badge.img+1
  • 52 replies
  • December 8, 2017

Hey @lojs,

I would try a Waterfall approach.

- assign a unique id to each candidate point.

- find the closest neighbor for each base point. (neighbors to find = 1)

- Check if more than 1 base are linked to the same candidate (based on the unique candidate_id) and keep the one with the closest distance.

- use a second neighborfinder to match the not linked bases to the not linked candidates.

You can repeat this process a third time if necessary or add a Maximum distance to check for neighbors (to ensure that your neighbors in the second iteration are not located on the opposite side of the map)

Your workspace should look something like this:

uniquecandidatesforeachbase.png


Forum|alt.badge.img+1
  • 52 replies
  • December 8, 2017

Hey @lojs,

I would try a Waterfall approach.

- assign a unique id to each candidate point.

- find the closest neighbor for each base point. (neighbors to find = 1)

- Check if more than 1 base are linked to the same candidate (based on the unique candidate_id) and keep the one with the closest distance.

- use a second neighborfinder to match the not linked bases to the not linked candidates.

You can repeat this process a third time if necessary or add a Maximum distance to check for neighbors (to ensure that your neighbors in the second iteration are not located on the opposite side of the map)

Your workspace should look something like this:

uniquecandidatesforeachbase.png

Just to clarify: the features that are outputted in the 'Sampled' output port are in this case seen as linked correctly. The NotSampled ones need to be used in the second neighborfinder to match them with the unmatched candidates.

 

 


Forum|alt.badge.img
  • Author
  • 5 replies
  • December 8, 2017

Thank you for your answers, I'll try the waterfall approach.

Regards, Louise


dave29
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 11 replies
  • November 25, 2019

I'm trying to do something similar. I'm trying to automate matching employees to work at shelters. I've created a shelter layer with a count field ordered by furthest distance from MBR centroid first and a field that has the number of employees needed. I have 47 shelters and I want to exclude employees after they are assigned to a shelter. I'm selecting one shelter at a time and running nearestneighbor, The first one assigns fine and I'm trying to loop within a custom transformer from unmatched candidates back to the candidate input. But, I'm getting "Transformer/Factory f_24 is blocking and cannot be used in a loop, but was found between 'Loop to test_Input1574712011 Input Splitter' and 'test_Input1574712011 Input Splitter"


dave29
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 11 replies
  • February 25, 2020

The waterfall approach does work. But, I'm working with emergency shelters and the list changes every year. Right now I have 47 shelters and I'm using an AttributeFilter to feed all 47 of the NeighborFinders. Next year I may have 50 or 45. There must be a way to use the neighborfinder in a more dynamic way than a separate one for each shelter.


  • 2 replies
  • May 19, 2021

Hey @lojs,

I would try a Waterfall approach.

- assign a unique id to each candidate point.

- find the closest neighbor for each base point. (neighbors to find = 1)

- Check if more than 1 base are linked to the same candidate (based on the unique candidate_id) and keep the one with the closest distance.

- use a second neighborfinder to match the not linked bases to the not linked candidates.

You can repeat this process a third time if necessary or add a Maximum distance to check for neighbors (to ensure that your neighbors in the second iteration are not located on the opposite side of the map)

Your workspace should look something like this:

uniquecandidatesforeachbase.png

Hi

This is exactly what I'am looking for aswell. Do you still have the screenshot "uniquecandidatesforeachbase.png" that shows the workspace? I could really need that to get some clues on how you solved the problem.