<div dir="ltr"><div dir="ltr">Thank you Ujaval,<div><br></div><div>I'll try this as well. Would you suggest to run it like a batch process on all origin-destination pairs, as the one suggested at point 22 of the tutorial?</div></div><div><br></div>Thanks a lot again and have a good weekend!<div>Francesca</div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 6 mag 2022 alle ore 16:47 Ujaval Gandhi <<a href="mailto:ujaval@spatialthoughts.com">ujaval@spatialthoughts.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">You need to do Distance Matrix. See <div><a href="https://www.qgistutorials.com/en/docs/3/origin_destination_matrix.html" target="_blank">https://www.qgistutorials.com/en/docs/3/origin_destination_matrix.html</a></div></div></div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 6 May 2022 at 7:33 PM, Francesca Parente via Qgis-user <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thank you very much indeed Nicolas, for your inputs and all the suggested materials!</div><div>I have 50 targets and 532 origins. My goal is to define where is best to go within the 50 destinations for each starting point - given the actual range of choices though, so I'm not sure that running a batch one-to-many would take into account all the variables properly as a many-to-many would do. In the absence of a specific modelling, also some second best could work.</div><div><br></div><div>I understand that your upstream-downstream-Dijkstra script is suitable for layer-to-layer indeed and I'm trying to run it, but at the >>> import geopandas as gpd<< line I got the following error message:</div><div><br></div><i>Traceback (most recent call last):<br>  File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode<br>    exec(code, self.locals)<br>  File "<input>", line 1, in <module><br>  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 799, in _import<br>    mod = _builtin_import(name, globals, locals, fromlist, level)<br></i><div><i>ModuleNotFoundError: No module named 'geopandas'</i></div><div> </div><div>I've been following your tutorial, but I admit I'm not quite familiar with py. I've gone through the remaining import coding and it seems working, but I'm not sure the "geopandas" module is needed or not to properly complete the script.</div><div><br></div><div>Thanks again!!</div><div>Best,</div><div>Francesca</div></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 5 mag 2022 alle ore 22:28 Nicolas Cadieux <<a href="mailto:njacadieux.gitlab@gmail.com" target="_blank">njacadieux.gitlab@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr">Hi,<div><br></div><div>How many shortest path calculations are you looking at? You could probably do a all pairs shortest path dijkstra and filter the results.  You could batch multiple one to many (point to layers)  In QGIS using the processing plug-in.</div><div><br></div><div>I did create an algorithm using networkX that could be modified to work with two input layers.  This could be useful if QGIS is not fast enough or if you have too many routes to calculate.  You will find it in the links below. Keep in mind this algorithm was for rivers therefore you have no trafic rules.  This would need more work.</div><div><br></div><div>You will also find an article we wrote in Data that may help.  If you have trouble with the network, look in the QGIS hub for the models. Look for the 3 “fix directional networks models”.</div><div><br></div><div>I added a few YouTube videos I made.</div><div><br></div><div><a href="https://gitlab.com/njacadieux/upstream_downstream_shortests_path_dijkstra" target="_blank">https://gitlab.com/njacadieux/upstream_downstream_shortests_path_dijkstra</a><a href="https://www.mdpi.com/2306-5729/5/1/8" target="_blank"> </a></div><div><br></div><div><a href="https://www.mdpi.com/2306-5729/5/1/8" target="_blank">https://www.mdpi.com/2306-5729/5/1/8</a></div><div><br></div><div><a href="https://plugins.qgis.org/models/" target="_blank">https://plugins.qgis.org/models/</a></div><div><br></div><div><a href="https://youtu.be/v61PafSByvM" target="_blank">https://youtu.be/v61PafSByvM</a></div><div><br></div><div><a href="https://youtu.be/qQrHcKtmr3o" target="_blank">https://youtu.be/qQrHcKtmr3o</a></div><div><br></div><div><br><div dir="ltr">Nicolas Cadieux<div><a href="https://gitlab.com/njacadieux" target="_blank">https://gitlab.com/njacadieux</a></div></div><div dir="ltr"><br><blockquote type="cite">Le 5 mai 2022 à 10:38, Francesca Parente via Qgis-user <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a>> a écrit :<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hello everyone,<div><br></div><div>I'd need to identify optimal destinations (within a point layer of geolocated facilities) for each territory of a given set of possible origins. </div><div>I already calculated a distance matrix between the two point-layers, and also applied the distance-to-nearest-hub tool to generate a string layer and identify the optimal facilities.</div><div>But I'd like to obtain a more realistic estimate, accounting for the roads network (and ideally their travel times). With quite a few issues, I finally managed to import an OSM road network from <a href="http://download.geofabrik.de" target="_blank">download.geofabrik.de</a> (in order to cover my area of interest, I had to merge two different vectors fo Center and Southern Italy and then extract a focus spot in between the two and save it as a lighter layer, otherwise it also took an eternity to run every analysis). <br></div><div><br></div><div>So now my question would be: is there a tool to perform a layer-to-layer shortest-path analysis that takes it into account? </div><div>All that I could find was either point-to-point or layer-to-point/point-to-layer (I looked also at built-in network analysis tool and Qneat3 plugin).</div><div><br></div><div>Any kind of inputs and suggestions will be more than welcome! </div><div>Thanks a lot for your support and have a good day,</div><div>Francesca<br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>----------------------------</div><div><font face="monospace, monospace" style="font-family:monospace,monospace;color:rgb(0,0,0)">Francesca Parente</font></div><div><font face="monospace, monospace" style="font-family:monospace,monospace;color:rgb(0,0,0)"><br></font></div><div><font face="monospace, monospace" size="1" style="font-family:monospace,monospace;color:rgb(0,0,0)">_ <a href="https://phd.uniroma1.it/web/FRANCESCA-PARENTE_nT1602922_IT.aspx" style="font-family:monospace,monospace" target="_blank">SESS Euro PhD</a> in SocioEconomic and Statistical Studies</font></div><div><font face="monospace, monospace" size="1" style="font-family:monospace,monospace;color:rgb(0,0,0)">_ <a href="https://sep.luiss.it/" style="font-family:monospace,monospace" target="_blank">Luiss SEP</a> School of European Political Economy</font></div><div><br></div><div><span style="font-family:monospace,monospace;font-size:x-small"><br></span></div><div><span style="font-family:monospace,monospace;font-size:x-small">email: </span><font style="color:rgb(32,18,77)"><a href="mailto:francescaparente.rse@gmail.com" style="font-family:monospace,monospace;font-size:x-small" target="_blank">francescaparente.rse@gmail.com</a><span style="font-family:monospace,monospace;font-size:x-small"> <br></span><font face="monospace" size="1" style="font-family:monospace;color:rgb(32,18,77)">       <a href="mailto:parentef@luiss.it" style="font-family:monospace" target="_blank">parentef@luiss.it</a></font> </font></div><div><br></div></div></div></div></div></div></div></div></div></div>
<span>_______________________________________________</span><br><span>Qgis-user mailing list</span><br><span><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a></span><br><span>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br><span>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br></div></blockquote></div></div></div></blockquote></div><br clear="all"><div><br></div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div></div>
</div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div></div><div><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;color:rgb(68,68,68);width:480px;font-size:10pt;font-family:Arial,sans-serif;line-height:normal"><tbody><tr><td valign="top" style="padding:10px 0px 12px;width:160px;vertical-align:top"><a href="https://spatialthoughts.com/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img border="0" alt="Logo" width="141" src="https://spatialthoughts685850346.files.wordpress.com/2019/12/spatial_thoughts_logo.png" style="border: 0px; vertical-align: middle; width: 141px; height: auto;"></a></td><td style="padding:6px 0px;width:320px"><table cellpadding="0" cellspacing="0" style="border-spacing:0px;border-collapse:collapse;background-color:transparent"><tbody><tr><td style="padding:0px;font-size:12pt;font-family:Arial,sans-serif;font-weight:bold;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Ujaval Gandhi</span></td></tr><tr><td style="padding:0px 0px 11px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(61,60,63)"><span style="color:rgb(0,175,239)">Spatial Thoughts</span></td></tr><tr><td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>mobile: +91-8095684687</span></td></tr><tr><td style="padding:0px;font-size:10pt;font-family:Arial,sans-serif;color:rgb(155,155,155)"><span>email: </span><span style="color:rgb(23,147,210)"><a href="mailto:ujaval@spatialthoughts.com" target="_blank">ujaval@spatialthoughts.com</a></span></td></tr><tr><td style="padding:6px 0px 0px"><span style="display:inline-block;height:22px"><span><a href="https://www.linkedin.com/in/spatialthoughts/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="LinkedIn icon" border="0" width="23" height="23" src="https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/ln.png" style="border: 0px; vertical-align: middle; height: 20px; width: 20px;"></a>  </span><span><a href="https://twitter.com/spatialthoughts" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img alt="Twitter icon" border="0" width="23" height="23" src="https://codetwocdn.azureedge.net/images/mail-signatures/generator/elegant-logo/tt.png" style="border: 0px; vertical-align: middle; height: 20px; width: 20px;"></a>  </span></span></td></tr></tbody></table></td></tr><tr><td colspan="2" style="padding:8px 0px 0px;border-top:1px solid rgb(23,147,210);width:480px;font-family:Arial,sans-serif;color:rgb(155,155,155);text-align:justify"></td></tr></tbody></table><br></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div></div></div></div></div></div></div></div></div></div>