Skip to main content
Question

Snap point to nearest point based on attributes


izabreton
Contributor
Forum|alt.badge.img+3

Hi,

I have 2 layers with points features in shp.

I want to create a tool that finds the nearest point from another layer of points only if the layer as the matching attributes and then snap to the nearest point, regardless of the distance, only the one that is closer to it and has the matching attributes.

Example: 2 points with a oak attribute as sort.

Thanks ahead!

Isabelle

5 replies

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • March 22, 2022

Hi @izabreton​ ,

You should be able to use the Group Processing parameter in the Snapper to accomplish this. Enable the Group Processing option by clicking the check box and entering which attribute you'd like to Group By. Note, order will be important here as the first point to arrive will be what everything that matches that group will snap to. You can set a large number for the Snapping distance so it is inclusive enough to catch everything you are interested in (same units as the source coordinate system).

2022-03-22_14-09-58


izabreton
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • March 22, 2022

Thank you Chris. The problem is that the attributes values don't match exactly and the points come from 2 different features class.

1. Trees.shp with attribute Sort with multiple values. I want only the ones with Oak as value

2. Trees. Shp with attribute Kind with with multiple values. I want only the ones with Oak as value.

​I was planning to filter the 2 tables to select only the points with oak as value and then find a tranformer to find the nearest point trees.shp to the trees2.shp.

​ Hope it makes sense.

 

 


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • March 22, 2022
izabreton wrote:

Thank you Chris. The problem is that the attributes values don't match exactly and the points come from 2 different features class.

1. Trees.shp with attribute Sort with multiple values. I want only the ones with Oak as value

2. Trees. Shp with attribute Kind with with multiple values. I want only the ones with Oak as value.

​I was planning to filter the 2 tables to select only the points with oak as value and then find a tranformer to find the nearest point trees.shp to the trees2.shp.

​ Hope it makes sense.

 

 

If you have a couple of sample files that I can be shared I would gladly take a look.

 

Sounds like you will need to filter out with a Tester and potentially create a temporary attribute so that both datasets have a shared attribute that allows you to perform the group by operation.


izabreton
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • March 23, 2022

Hi, thanks. I can send you a private message. Can I have your email?


chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • March 23, 2022
izabreton wrote:

Hi, thanks. I can send you a private message. Can I have your email?

Just sent you an email :)


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