I have feature classes of lines (roads) and two types of point feature classes (let’s call them “sources” and “sinks”; there are many sinks for every source). For every source, I need to trace the paths to its nearest sinks such that each path has an attribute for length and a count of the sinks it serves. Normally, it would be possible to do this with the Network Analyst extension in ArcGIS (correct me if I’m wrong), but I currently do not have access to that extension. What are some other tools with which one can accomplish this? Can this be done in QGIS or GRASS GIS? Or does anyone know whether the OSMnx package in Python can be used for this, and can the result be exported to ArcGIS? I know that this has already been discussed here, but I wonder if anything has changed since that discussion.

  • You could explore the use of the python module networkx which can be run in ArcGIS environment?
    – Hornbydd
    Jun 27 at 18:38
  • Thanks! I'll look into using the networkx module. Jun 29 at 17:46
  • Can networkx really be run in ArcGIS environment? Don't they require different versions of Python (3.6 or higher for networkx, while ArcGIS on my computer runs on Python 2.7.3)? Jun 30 at 15:51
  • No, I just typed C:\Python27\ArcGIS10.6\Scripts at the command line prompt then pip2.7 install networkx and it installed it. I can then import it in the python console in Arcmap.
    – Hornbydd
    Jun 30 at 16:25
  • Thanks! I'll try doing it this way. Jun 30 at 16:29

You can use geometric network and Utility Network tools for this task. First picture shows original network:

enter image description here

Second shows results of Find Path Upstream task:

enter image description here

As one can see it successfully locates all nearest sources.

To get counts simply specify type of results returned:

enter image description here

Network shown is a tiny fraction of collecting network -streams reaches (2M total!), flow direction -WITH_DIGITIZED_DIRECTION. I don't see a reason why it will not work with distribution network.

Note: all tasks are automatable using tools from Geometric Network toolset.

My personal preference is networkx module, but it getting slow with graphs that have over 50K edges.

  • Thanks! Unfortunately, I don't have the license for the Geometric Network toolset, either. But I will look into the networkx module. The networks I work with are big, but they seldom have 50K edges. Jun 29 at 17:55

I've tried the Networkx module in Python. From what I can see, though, it only draws a path from node to node on a graph, not following the curves in the edges. Thus, if finding a distance along a road network is what's needed, Networkx returns only an approximation of it. I'm yet to find out whether this is good enough for my purposes. In case it isn't, someone has elsewhere recommended the QNEAT3 plug-in for QGIS. Can anyone else suggest other alternatives to the Closest Facility solver that return a more exact route?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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