I read over the solution in Distance between points along polyline ArcGIS for Desktop? and I have a slight variation of that problem:

I need to find the distance of each red point (transformers) from the yellow point (the main generator) along the distribution network.

Overview ZoomedId

Each transformer receives power from the main generator. I've included a screenshot of (a) large-scale view and (b) small-scale view (green box). Each line has a distance attribute in feet, which I've labeled. The lines do not inherently "flow" toward or away from the generator, directionality is arbitrary (see blue circled).

A line exists between each transformer, so we never need to find a "midpoint" distance per-se, transformers always intersect line endpoints/startpoints.

If there are multiple routes to reach the main generator, we need to find the the shortest route (I believe there is always only one conceivable route from transformer to generator in this data, but just in case...).

What is the best way to go about this?

  • Modify the "chainage" code mentioned above to process multiple line segments en route to a specific point an unknown distance away? Challenge is how would script know which path to take when the network forks en route to the generator?
  • Create a script to perform some sort of "Select by Location" ==> select network lines that intersect generator, then select network lines that intersect selected network lines recursively, causing the whole selection to propagate upon each iteration until the whole thing intersects the transformer of interest, then whittle the selection down to the route between the transformer of interest and generator (somehow), and sum the distances of lines along the route?
  • Read up on Linear Referencing and apply it here. I have certainly never used Linear Referencing in my career so far, but if M-enabling the data will solve my problems, I will gladly do due diligence.
  • Pretend our data is in Google Maps and use the Google Maps Distance Matrix API via Python wrapper. The Origin is the generator. The List of Destinations would be all the transformers. Get distance for each route. This option is obviously facetious, but could we use Network Analyst to do some of the logic above?
  • 1
    Is your data in a geometric network? Do you have any .net ability? There is a white paper by Esri discussing linear modelling with networks that might help edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/shared/… or you could implement Dijkstra's algorithim for each 'to' point starting at your source. Commented May 9, 2016 at 6:02
  • As it stands I think your question is too broad because it is effectively asking four questions i.e. will method 1 work? will method 2 work? etc and then for whichever is the "best" of them. I think you should choose which method you favour, and then pursue that to see if it does work. When/if you get stuck on that method then you will have a more focussed question to ask that includes what you have tried.
    – PolyGeo
    Commented May 9, 2016 at 6:14
  • 1
    To me, this looks like a perfect candidate for Linear referencing. Each line would get measures and the transformers are events along the lines.They should all be drawn from the main transformer. Also, I'm voting to reopen this as I think there is enough information here.
    – Fezter
    Commented May 9, 2016 at 6:18
  • 2
    You can try Network Analyst extension (if you have access to that). You can give transformers as incidents and generators as facilities and it will give the best (shortest) route for all transformers.
    – Zsott
    Commented May 9, 2016 at 7:37
  • +1 I am also voting to reopen it
    – FelixIP
    Commented May 9, 2016 at 7:44

1 Answer 1


If you want to find the shortest distance between the yellow point and any red point then this can be done using several techniques.

I would imagine by far the fastest would be linear referencing but as you have lines pointing in different directions then that won't work without time spent editing the network and ensuring every line is flowing towards the yellow point, something you may not want to do.

Next fastest approach would write code to traverse the network links computing distance, but this requires a good understanding of network topology and how to read it using code.

Now finally something alluded in the comments by @Zscott and that is the use of network analyst. You could create a simple model (so no coding required) that would generate the route from yellow point to every single other red point. Now this won't be the most efficient method but it is something that can be knocked together quickly to create polylines between all points.

I've had to something similar with a road network with people travelling from their homes (think of those as red dots) to their place of work (yellow dot)

Below is the model that we used:


The trick in this model is that the first add location overwrites, the second add location appends so that it only ever creates a single route between yellow and 1 red point.

This model saves out the polyline into a separate FeaureClass, it would be up to you to merge these into a single dataset.

Your Answer

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

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