[Qgis-user] Qgis 3.6 network analysis

Bernd Vogelgesang bernd.vogelgesang at gmx.de
Tue Apr 16 06:43:42 PDT 2019


Hi Nicolas,

I'm neither familiar with networks nor rivers nor python, but i made
myself befriended with R in the last years. I never used it from inside
QGIS but "standalone" with R studio.

As it's a real data-cruncher and easy to debug the code line by line, I
use R for all "more complex" situations where you have to find your way
by trial-and-error to the final solution.

I can just recommend to have a look at this
https://cran.r-project.org/web/packages/riverdist/vignettes/riverdist_vignette.html
page, as it looks quite promising to what you want to achieve (from
quick read)

In case you are interested in trying that route, just contact me in case
of questions / assistance etc.

Cheers,
Bernd

Am 16.04.19 um 06:13 schrieb Nicolas Cadieux:
> 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
>
>
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-user mailing list