[Qgis-user] Qgis 3.6 network analysis

Nicolas Cadieux nicolas.cadieux at archeotec.ca
Mon Apr 15 21:13:44 PDT 2019


Hi again,

Thanks Nyall, Micha and Alessandro for your help on correcting the river 
flow directions.  I am still working on it but you gave me the right 
tools.  The next step of my project will be to use my river flow network 
and find the shortest path between THOUSANDS of points (so I will need 
to batch it or script it in Python).

It gets complicated as I will need to calculate the total trip for each 
shortest path (easy) and then the percentage of that trip that was made 
going downstream (the rest being the upstream trip).  I don't know if 
there is a tool for that?  If not, my goal was to use the shortest path 
lines to do a spatial query on my network and figure things from there.

Anyways, I don't have much experience with networks so that's what I 
need to figure out.  I also mostly use Python outside of QGIS so my 
questions are basic for now.  I see that many plugins have been 
incorporated in Processing but the Shortest path (point to point) builds 
a new graph every time.  I figure I need to build a graph but that does 
not seem to be available in QGIS 3.6.

I found this 
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/network_analysis.html#building-a-graph 
but the very first command "from qgis.networkanalysis import *" in the 
QGIS python console  indicates "ModuleNotFoundError: No module named 
'qgis.networkanalysis'".

Question 1: Is the qgis.networkanalysis module being replaced or renamed 
in QGIS 3.6 (OSGEO4w64 intall)?

Question 2: Since I will have THOUSANDS of shortest path lines to 
calculate, is QGIS the best tool for the job?  Should I be looking at 
NetworkX or iGraph? I played a bit with QNEAT3 but I don't know if I can 
get it to create just a graph.  If you have any good examples of making 
a graph from a shp file and then making a shortest path analysis, please 
send it my way.

Question 3: What would be the best tool (or best practice) to check my 
network integrity? v.clean?

Thanks again,

Nicolas







More information about the Qgis-user mailing list