Skip to main content
2 of 4
corrected spelling
PabloQG
  • 309
  • 1
  • 3
  • 10

Measure distance between vertices of polylines in QGIS for Desktop

I have this dataset of coordinates of electric lines in the form of vector polylines as shown in the image below, and I need to measure the distance between the first and last vertex of each line and all the other line vertices on the layer using PyQGIS. For example, take the first vertex of the first line and measure the distance between this one and all the others on the layer; then take the last vertex of the first line and measure all the distances, and repeat the same for the second line and so on.

I think that a good solution is to get the coordinates of the first and last vertices for each feature, save them as a point and then apply the method explained in this post: Measure distances between specific features in QGIS for Desktop to get the distances between points.

I would appreciate some orientation on how to do this. enter image description here

PabloQG
  • 309
  • 1
  • 3
  • 10