Bug report #17325
QGIS 2.99 with Network Analysis Error
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Network | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Windows 10 Enterprize | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 25223 |
Description
Hi there,
I am testing the Processing Toolbox>Network Analysis>Shortest Path tools to find the shortest paths from a point feature, along a road network to a final point.
During my testing I receive an error, which occurs with the other tools.
The data I am using is shapefiles.
Attached are errors I receive using each tool.
Associated revisions
[processing] Shortest path handling for multipoint layers
Fixes shortest path algorithms fail for multipoint source layers
or layers with null geometries
Refs #17325
Fix broken network analysis network tolerance option
The tolerance option was not correctly calculated, resulting in
semi-random behavior for networks which relied on a non-zero
tolerance.
Also possible speed boost for complex networks by using
proper spatial index instead of custom sorting/filtering code.
Refs #17325
Fix QgsGraphAnalyzer::dijkstra traverses through edges backwards
This means that it flips the direction of the graph edge, breaking
route restrictions.
Refs #17325
[processing] Misc fixes for network analysis tools
Also maintain attributes in service area from layer alg, add test
Fixes #17325
History
#1 Updated by Nyall Dawson about 7 years ago
- Subject changed from QGIS 2.99 with Grass 7.22 Network Analysis Error to QGIS 2.99 with Network Analysis Error
- Status changed from Open to Feedback
- Affected QGIS version changed from 2.8.9 to master
Can you please attach your data files?
#2 Updated by Joshua Geoghegan about 7 years ago
- File Roads.zip added
Hi Nyall,
Shapefiles attached.
I renamed them for you to make sense of them.
I used the layer to point option, but none of the tools worked.
Thanks
Josh
#3 Updated by Nyall Dawson about 7 years ago
#4 Updated by Nyall Dawson about 7 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|8f22f5eb3b7ad277b6ef2061ef91d1085c133d4a.
#5 Updated by Nyall Dawson about 7 years ago
Should be fixed in the next nightly release. Some things to note:
1. Your road network has small gaps, so you'll need to set a tolerance (under advanced) of something like 0.1
2. You'll get much better results if you pre-process your road network a bit. I'd suggest:
- simplifying
- 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.
#6 Updated by Joshua Geoghegan about 7 years ago
- File shortest_routes.jpg added
Hi Nyall,
We have been using this and following your instructions.
Sometimes the path takes an indirect route even when the linework is quite simple, which you can see from the attached image.
The blue dots are the start point, well the nearest road. You can also see a couple of points aren't being included.
We have played with the topology tolerance but it doesn't seem to help.
Would you have any advice on this?
Thanks again.
Josh