Skip to main content
Question

NeighborFinder to two

  • May 5, 2023
  • 7 replies
  • 87 views

timalm
Contributor
Forum|alt.badge.img

Hi, Im struggling a bit with finding nearby points to another point layer. I want the Neighborhoodfinder to find the two closest points within a distance. The output file only includes the nearest point even though I have set the neighbors to find parameter = 2.

 

I want the output file to include the two closest points and their distance.

Any suggestions?

Thanks in advance!

image

7 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 627 replies
  • May 5, 2023

The Number of Neighbors to Find only applies when you are using the Generate List option. For each neighbor found, it will be included in the specified list. You might also consider the NeighborPairFinder.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • May 5, 2023

As @dustin​ says, you'll need to generate a list to get the two nearest points. You'll then need to explode that list if you want to have information about both points in your output file. Make sure in the List Exploder Conflict Resolution is set to Use List Attribute Values


timalm
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • May 5, 2023

Thanks you both for quick reply!

It goes in the right direction according to your input.

Now the same point is counted twice. Does something need to be added to make it find the next closest as well?

image


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 627 replies
  • May 5, 2023

Thanks you both for quick reply!

It goes in the right direction according to your input.

Now the same point is counted twice. Does something need to be added to make it find the next closest as well?

image

I think the NeighborPairFinder is going to be better in your situation. According the help description, it should do exactly what you are asking for.


timalm
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • May 5, 2023

I think the NeighborPairFinder is going to be better in your situation. According the help description, it should do exactly what you are asking for.

Yes it did, much thanks!

It's just that if the second point is over the Maximum Distance value, the point is not included in the output file. I would like it to have a distance value 0 then.


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 627 replies
  • May 5, 2023

I think the NeighborPairFinder is going to be better in your situation. According the help description, it should do exactly what you are asking for.

Instead of using the Maximum Distance in the NeighborPairFinder, I would leave that parameter <null>, which should find you two points regardless of distance. Then you can use an AttributeCreator with conditional parameters saying if Distance is >= your 3000 (or whatever your set distance is), then set Distance value to 0.


timalm
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • May 5, 2023

I think the NeighborPairFinder is going to be better in your situation. According the help description, it should do exactly what you are asking for.

Smart, much thanks ddbrocato!

Take care