Bug report #17475
QGIS 2.99 Shortest Path not showing shortest route
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Windows 10 Enterprize||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||invalid|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25372|
I have been using the Shortest path plugin to get the shortest route between a set of points, along a road network to a primary destination.
Sometimes this works fine but in some areas the routes are indirect. In some cases some start points aren't picked up at all. See attached jpg where both routes are not correct and some points are ignored.
I have followed the suggested steps of cleaning up the road network with
- run the 'snap geometries to layer' algorithm over it, and snap it back to itself (will move nearby vertices so that they exactly coincide)
- run the 'split with lines' algorithm over it, using the snapped layer as both the source and split layer (will create additional nodes where lines overlap, which the network analysis tools require)
- run 'multiparts to singleparts' on the result.
I've played around with the topology tolerance with little or no luck.
Is this a bug or something that I have missed?
#2 Updated by Borys Jurgiel over 3 years ago
- Category changed from Plugin Manager to Processing/QGIS
Right, it's not a plugin anymore.
Your problem looks like some line ends within the unregarded shortcuts still don't overlap. You can examine their coordinates (zooming in may be enough to see the gap) or put starting and ending point close to the suspected vertex in order to see if the algorithm still avoids it.
If you won't find gaps in those places, could you please attach a sample dataset with the affected area?
#4 Updated by Borys Jurgiel over 3 years ago
- Status changed from Open to Closed
- Resolution set to invalid
- File shortest_routes.png added
Your data misses some vertices, so the lines are not connected (please note two lines are only connected if they both have a vertex in the same place). I marked such missing connections for two destinations.
Btw. the dataset you attached contains more missing routes than the screenshot - e.g. in the roundabout's neighbourhood.
#7 Updated by Giovanni Manghi over 3 years ago
Joshua Geoghegan wrote:
Thanks for that.
Does QGIS have a plugin to create vertices where lines intersect?
Snapping doesn't seem to add these missing vertices.
I've also tried extending lines slightly and split lines but the results are the same.
use the processing toolbox, specifically the v.clean tool from GRASS, "break" option.