Skip to main content
Question

NeighborPairFinder between lines


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?

7 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 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+16
  • Supporter
  • 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
  • October 5, 2018
gio wrote:

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
  • 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
  • October 5, 2018
itay wrote:

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
  • 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
  • October 5, 2018
gio wrote:

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

 


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