I have two layers with points, call them A and B, each with different attributes.
For each point in A I want to join all the attributes from the nearest point in B.
Ideally this would also include a field measuring the distance between both points.
I know how to so this in ArcGIS: right click layer A>joins and relates>joins, then join data based on spatial location and choose to join attributes from nearest point.
I could not find similar functionality in QGIS. Any pointers?
Answer
Using "Distance Matrix" you can calculate the nearest point. Make sure that both layers are in the same CRS! Then, you can load the results and use them to join table A and B.
In "Distance matrix" chose: "Linear distance matrix" and "use only the nearest k target points: 1"
Load the CSV using "Add Vector Layer" and join the layers in Layer A's layer properties - join tab.
And the result:
No comments:
Post a Comment