2

This question already has an answer here:

I am looking to create a Python script that will take X,Y coordinates from one field in an attribute table, compare them to another set of X,Y coordinates in a different field, and populate a field with the shortest distance between those two points based on a road layer. So just to visualize it..

Origin:X,Y      Destination:X,Y         Distance: 130.34km

marked as duplicate by underdark qgis Nov 22 '16 at 19:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and code so far. For more info, you can check our faq. – underdark Feb 20 '15 at 23:36
  • Is there a reason you want to create a plugin? The attribute table tool already has built-in functions to compute complex expressions such as the distance between two points. – ArMoraer Jan 14 '16 at 15:38

Browse other questions tagged or ask your own question.