1

I have multiple points on multiple lines in a network and I need to know the length between these points along the network. I need an OD matrix, like the QNEAT3 distance matrices but for the distance along the network. It's for multiple points, so point and click wouldn't be efficient. Ideally the solution is a similar to the Network Analysis > Shortest Path (point to layer), but it's layer to layer.

Please only suggest QGIS solutions. enter image description here

3
  • 1
    how are the lines digitised? Are they individual segments or one large line? One solution could be to simply dissolve all lines. Split lines with points. Then calculate the length of each segment.
    – itsgupta
    Mar 23, 2021 at 23:26
  • wow, you are a genius!!!! That sounds like the perfect solution to my issue. Thank you very much!
    – GDP
    Mar 23, 2021 at 23:39
  • Ill post it as an answer, if you could please accept that too. Thanks
    – itsgupta
    Mar 24, 2021 at 0:57

1 Answer 1

2

The solution may be dependent on how are the lines digitised. Are they individual segments or one large line.

One solution could be as follows:

  1. Dissolve all lines
  2. Split lines with points
  3. Calculate the length of each segment using $length or length($geometry)

This will cause issues with the attributes, consider running join by location on the final output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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