I am trying to calculate the difference between the positions of the same point on two different layers. One layer is a shapefile, other layer is a text file, and each point has a unique identifier, Stationval. Found something similar, using a virtual layer, however my python skills are not good enough to convert this. Was also looking for the Points2One plugin, with no avail.
2 Answers
With all due respect, your question has me confused. If they are "...the same point..." wouldn't the distance thus be zero? I mean, they are the same point, after all.
But, in spite of my confusion, perhaps I can point you to two QGIS tools that may be of help:
- NNJOIN Plugin: Determines the distance From each feature to its nearest single feature
- Vector > Analysis Tools > Distance Matrix tool: This returns the distance from each feature to every other feature (pairwise comparison).
-
Thank you Stu Smith, nnjoin did the trick. Sorry for not being clear enough: one layer has the points as planned, other layer points on field.– szilardCommented Nov 30, 2018 at 8:58
-
you can use the field calculator with a expression like that:
distance(geometry(get_feature('LayerA','ID_ColumnA','ID_A')),geometry(get_feature('LayerB','ID_ColumnB','ID_B')))
-
Thank you eurojam, I shall try your suggestion to see what solution is the most suitable for me.– szilardCommented Nov 30, 2018 at 9:00