Class: QgsGraphDirector

class qgis.analysis.QgsGraphDirector

Bases: PyQt5.QtCore.QObject

Determine making the graph. QgsGraphBuilder and QgsGraphDirector implemented using “builder” design patter.

addStrategy(self, prop: QgsNetworkStrategy)

Add optimization strategy


prop (QgsNetworkStrategy) –

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
makeGraph(self, builder: QgsGraphBuilderInterface, additionalPoints: Iterable[QgsPointXY], feedback: QgsFeedback = None) List[QgsPointXY]

Make a graph using QgsGraphBuilder

  • builder (QgsGraphBuilderInterface) – the graph builder

  • additionalPoints (Iterable[QgsPointXY]) – list of points that should be snapped to the graph

  • snappedPoints – list of snapped points

  • feedback (QgsFeedback = None) – feedback object for reporting progress


if snappedPoints[i] == QgsPointXY(0.0,0.0) then snapping failed.

Return type


name(self) str

Returns director name

Return type


receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
timerEvent(self, QTimerEvent)