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.
- 20,017
- 15
- 45
- 64
- 91
- 1
- 7
2 Answers
You can use geometric network and Utility Network tools for this task. First picture shows original network:
Second shows results of Find Path Upstream task:
As one can see it successfully locates all nearest sources.
To get counts simply specify type of results returned:
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.
- 22,922
- 3
- 29
- 61
-
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. – Borillar0821 Jun 29 '21 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?
- 91
- 1
- 7



C:\Python27\ArcGIS10.6\Scriptsat the command line prompt thenpip2.7 install networkxand it installed it. I can then import it in the python console in Arcmap. – Hornbydd Jun 30 '21 at 16:25