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.
-
1how 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.– itsguptaMar 23, 2021 at 23:26
-
wow, you are a genius!!!! That sounds like the perfect solution to my issue. Thank you very much!– GDPMar 23, 2021 at 23:39
-
Ill post it as an answer, if you could please accept that too. Thanks– itsguptaMar 24, 2021 at 0:57
1 Answer
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:
- Dissolve all lines
- Split lines with points
- 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.