I'm trying to calculate a sample distance matrix from four points in the BNG CRS: enter image description here

Using Vector-> Analysis Tools -> Distance Matrix, I get: Input point layer is a MultiPoint layer - first convert to single points before using this algorithm

**Input point layer is a MultiPoint layer - first convert to single points before using this algorithm**

How can I get a distance matrix from my layer of many points?

  • 2
    in future please put the text of your errors in the question not a picture of the error which is much harder to read – Ian Turton Mar 19 '19 at 12:12
  • Yup! Did both since wasn't sure what one would need to help :) – Newb Mar 19 '19 at 16:50

The error gives also an answer: convert to single points first. This can be done with the algorithm 'Multipart to singleparts'.

You can link both algorithms in the graphical modeller: processing > graphical modeller (or ctrl + alt + m)

  • define as input 'vector layer' and set as point
  • link this with algorithm 'Multipart to singleparts'
  • link output of previous with algorithm 'distance matrix' -> define an output

![enter image description here

Now it should work in one step and can be reproduced for other layers.

  • I'm not familiar with the graphical modeler (looks super powerful though), so I tried splitting the points via the same command in the toolbox, but it wont let me: layers were not correctly generated – Newb Mar 19 '19 at 17:00
  • UPDATE: created the workflow, but can't add it to my toolbox because *shutil.SameFileError: * – Newb Mar 19 '19 at 17:18
  • May be this can help. It is not for Qgis 3.x but it works gis.stackexchange.com/questions/162120/… – Gerardo Jimenez Mar 19 '19 at 20:55
  • @Newb: I don't know what this error means. But can you share your files? So I can do some tests on it? – PieterB Mar 20 '19 at 8:58
  • 1
    @PieterB, I solved: 'shutil.SameFileError:': QGIS didn't like having the model saved into models path directly. I needed to let it load from another directory. (Basically, QGIS doesn't want to load the model since it was in the models folder, but because it wasn't loaded through QGIS I couldn't access it through the GUI). Hope this helps someone else. – Newb Mar 20 '19 at 12:12

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.