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 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.
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?