Question

NeighborFinder to two


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

Userlevel 3
Badge +26

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.

Userlevel 1
Badge +21

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

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

Userlevel 3
Badge +26

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.

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.

Userlevel 3
Badge +26

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.

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

Reply