This question already has an answer here:

I have a stream network dataset and am attempting to do a distance analysis between paired points located in two different layers. Ex. I have 500 points in layer A with given coordinates, and then 500 points with different coordinates in layer B. I plan to base the distance-pairing on a shared ID. Having looked at other questions related to this, I have often seen the OD Cost Matrix suggested as a solution, or tools that give linear distance. I don't think the OD Cost Matrix will work for me- I want the stream network distance between the points that share an ID, not the distance between Point A and all other points.

marked as duplicate by PolyGeo arcgis-desktop Jun 17 '16 at 20:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Insert additional nodes at intersections with points. Use any shortest path algorithm to find relative distances. Network x package is a way to go – FelixIP Jun 17 '16 at 19:38
  • @PolGeo this is not exact duplicate because from A to B it could be very well going downstream to relevant junction and continue upstream to B. This is what boats do. Referred answer deals with directional graph – FelixIP Jun 18 '16 at 2:50

I actually just did something like this not too long ago. Have a look at my answer to Finding distance between points in two different layers along route in ArcMap?. I used Python to find the distance along a line between two points that intersect each line.

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