I have two layers, one with lines and the other with points. Layer one has all the points (A to J) as shown below and layer two has all the lines connecting these points. Is there an automated way (in ArcGIS or shapely or anything) to calculate the distance between every pair of points where my definition of distance is the actual length of the connecting lines?
Please note that I am not looking for line-of-sight distance between points which can be computed using Haversine or Vincenty.