From 44126e3068699992e99f770d1e74530055f2e90a Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 22 Apr 2024 14:26:48 +1000 Subject: [PATCH] Fix crashing test Add missing strategy call --- docs/pyqgis_developer_cookbook/network_analysis.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pyqgis_developer_cookbook/network_analysis.rst b/docs/pyqgis_developer_cookbook/network_analysis.rst index bee35f78f92..2231174e629 100644 --- a/docs/pyqgis_developer_cookbook/network_analysis.rst +++ b/docs/pyqgis_developer_cookbook/network_analysis.rst @@ -383,6 +383,8 @@ uses the :meth:`shortestTree() ` me vectorLayer = QgsVectorLayer('testdata/network.gpkg|layername=network_lines', 'lines') builder = QgsGraphBuilder(vectorLayer.sourceCrs()) director = QgsVectorLayerDirector(vectorLayer, -1, '', '', '', QgsVectorLayerDirector.DirectionBoth) + strategy = QgsNetworkDistanceStrategy() + director.addStrategy(strategy) startPoint = QgsPointXY(1179661.925139,5419188.074362) endPoint = QgsPointXY(1180942.970617,5420040.097560)