Skip to main content
Question

NeighborPairFinder between lines

  • October 4, 2018
  • 7 replies
  • 70 views

Forum|alt.badge.img

Hi! I need to find Neighbor Lines from Blue (Base) to Red ones (Candidates) and have the average distance between these neighbors. So i splited lines into vertex and for each genererated find the closest line and then calculate average with a StatisticsCalculator. It worked graat but only for one Neighbor. I tried use NeighborPairFinder but it doesn't work to, becouse it found neighbors when Blue lines have more than one neighbor.

Any suggestion?

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.

7 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • October 4, 2018

If you use the neighborpair finder, then the outer blue line will only find pairs if the range is equal or larger then the distance between the outer red and outer blue line. ( as the help says..."

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

Best to build an iterative neighborfinder, with keep candidates ex_or base option.


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • 1442 replies
  • October 4, 2018

You can set the max distance to a large value and add a list to the results see attribute accumulation section in the NeighborFinder.

Naturally the number of neighbors to find should be more than 1.

You can then explode the list elements or search in the list for more neighbors.

Hope this helps, Itay


Forum|alt.badge.img
  • Author
  • 14 replies
  • October 5, 2018

If you use the neighborpair finder, then the outer blue line will only find pairs if the range is equal or larger then the distance between the outer red and outer blue line. ( as the help says..."

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

Best to build an iterative neighborfinder, with keep candidates ex_or base option.

but when i have only set of two: blue and red lines (not 4 like in the picture) NeighborPairFinder doesn't find any neighbor... I changed the range a lot.

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • October 5, 2018

@tram

Hi I tried your setup with the neighborpairfinder.

And get same result as you do. It will only do 1 base in this setup.

Because the separation angle is the limiter?

If you use a second neighborpairfinder on the unmatchedbase with a negative separation angle, it will match it. (though only to closest line twice ?!?.)

Don't know if this is intended behavior....maybe safe can say?

You need 2 neighborfinders for to do it. Or a iterative NBF with options.


Forum|alt.badge.img
  • Author
  • 14 replies
  • October 5, 2018

You can set the max distance to a large value and add a list to the results see attribute accumulation section in the NeighborFinder.

Naturally the number of neighbors to find should be more than 1.

You can then explode the list elements or search in the list for more neighbors.

Hope this helps, Itay

It could be a good idea but for my data not enough becouse my lines are composed of many smaller ones so it looks in many places like this:

 

<br><div></div>maybe is it possible to ask the condition to look for neighbors on the left and right side?

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • October 5, 2018

That can be solved by making a (nested) custom transformer to iterate neighbor finding.

One can then have options: "keep Candidates" and/or "Keep bases". In case "and" you can control the iteration count.

(is what I did anyways). I use it very often.

Safe should built a general one.

A


Forum|alt.badge.img
  • Author
  • 14 replies
  • October 5, 2018

That can be solved by making a (nested) custom transformer to iterate neighbor finding.

One can then have options: "keep Candidates" and/or "Keep bases". In case "and" you can control the iteration count.

(is what I did anyways). I use it very often.

Safe should built a general one.

A

interesting... but where did you get this transformer from? I can not find it anywhere..