I have a shapefile of points and want to measure the distance between each of them. After running the Distance Matrix command I get a matrix with distances as expected, but have no idea how to match each row (i.e. each point) to each other.

The problem arises because the names of the columns is not informative of which point each distance refers to. Snapshot of Distance Matrix Output

Clearly the first column refers to the distance between each point and itself. But, for example, how do I know what two points define the distance in row 1, column 2?

  • Check that Dist_2 is referring to the distance between point of ID = 1 to point ID = 2... do some labeling and measuring in QGIS and see what those column labels are referring to... Commented Nov 9, 2016 at 16:31
  • If so why is distance from point with ID 2 not 0 to Dist_2 point? Commented Nov 9, 2016 at 16:50
  • Are you pointing to the correct unique ID Fields? I run this with several variations of the tool and everything is working fine... Commented Nov 9, 2016 at 18:52
  • As @GerardoJimenez says, the distances seem to alude to different combinations of points, not in order of ID but it order of distance between each other.
    – Francisco
    Commented Nov 14, 2016 at 12:13

1 Answer 1


Depending on what exactly you want to do with the data once you know the start, end and distance between the points you may find that the "Linear (N*k x 3) distance matrix" output matrix type is sufficient. This option is set within the QGIS Distance Matrix Tool.

The image shows the difference in table layout. As you can see the distances are identical, so the difference is only in the presentation of the data in the table.

enter image description here

The option is available at least from QGIS 2.0 onwards (haven't got any older versions available to check further back right now).


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.