I have a polyline (movement path) and points recorded along the line. I would like to calculate for each point the distance along the line in Quantum GIS. I hope for a result which will add a new column to the point attribute table indicating the distance along which it is on the line. I'd appreciate any thoughts.



If you'd like to go with the GRASS plugin, there's a module v.distance that does just that. First you'll bring the polyline and point layers into GRASS using the v.in.ogr module in the GRASS Toolbox. Then locate the v.distance module. The From and To vectors are obviously the points and line. Then select "Distance to nearest point ... along linear feature". You'll also need an attribute column name to accept the distance values (Use v.db.addcol to add that attrib if you don't already have). That should do it.

  • Many thanks Micha. Sorry I was away and could not give feedback before now. The v.distance module is exactly what I needed. Very many thanks. – Gabz Jun 3 '12 at 21:17
  • Note that the label currently reads (in QGIS 2.2) "Distance between points/centroids ... along this linear feature" – byteit101 Jun 25 '14 at 17:58
  • I can't seem to find this option/label anywhere in QGIS 3.2 Anybody has a clue if I'm wrong or if there is a workaround? So far, I couldn't find anything to resolve this issue in 3.2... – Horizen Oct 12 '18 at 22:10
  • It doesn't work in 3.10 or 3.12 – Jacques MALAPRADE Mar 4 '20 at 14:49

Other way to measure this, it is using Qchainage (QGis plugin) to produce nodes equallly spaced from line. Then, you may use Distance to nearest hub (QGis plugin) to calculate distance among points.


The KP Find plugin does this with a layer of points and another layer, containing a line feature. It projects a point on the line and gives the geodetic distance along the line and the distance to that line. It has an interactive mode or can iterate over an entire point layer, adding new attribute fields.


Indeed KP Find plugin is what you looking for, combining with processing modeler make your life easier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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