1

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.

enter image description here

2 Answers 2

2

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:

  1. NNJOIN Plugin: Determines the distance From each feature to its nearest single feature
  2. Vector > Analysis Tools > Distance Matrix tool: This returns the distance from each feature to every other feature (pairwise comparison).
2
  • 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.
    – szilard
    Commented Nov 30, 2018 at 8:58
  • Great, happy to help!
    – Stu Smith
    Commented Nov 30, 2018 at 18:59
1

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')))
1
  • Thank you eurojam, I shall try your suggestion to see what solution is the most suitable for me.
    – szilard
    Commented Nov 30, 2018 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.