Bug report #17325

QGIS 2.99 with Network Analysis Error

Added by Joshua Geoghegan about 7 years ago. Updated about 7 years ago.

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.

shortest path point to point log.txt Magnifier (994 Bytes) Joshua Geoghegan, 2017-10-25 03:28 AM

shortest path point to layer log.txt Magnifier (1.09 KB) Joshua Geoghegan, 2017-10-25 03:28 AM

shortest path layer to point log.txt Magnifier (1.09 KB) Joshua Geoghegan, 2017-10-25 03:28 AM

service area from point log.txt Magnifier (922 Bytes) Joshua Geoghegan, 2017-10-25 03:28 AM

service area from layer log.txt Magnifier (1.03 KB) Joshua Geoghegan, 2017-10-25 03:28 AM

Roads.zip (702 KB) Joshua Geoghegan, 2017-10-25 11:48 PM

shortest_routes.jpg (118 KB) Joshua Geoghegan, 2017-11-15 05:22 AM

Associated revisions

Revision 5ffd7214
Added by Nyall Dawson about 7 years ago

[processing] Shortest path handling for multipoint layers

Fixes shortest path algorithms fail for multipoint source layers
or layers with null geometries

Refs #17325

Revision 199b5692
Added by Nyall Dawson about 7 years ago

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

Revision 8d32bf72
Added by Nyall Dawson about 7 years ago

Fix QgsGraphAnalyzer::dijkstra traverses through edges backwards

This means that it flips the direction of the graph edge, breaking
route restrictions.

Refs #17325

Revision 8f22f5eb
Added by Nyall Dawson about 7 years ago

[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

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

#4 Updated by Nyall Dawson about 7 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

#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

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

Also available in: Atom PDF