Class: QgsGraphDirector

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

Class Hierarchy

Inheritance diagram of qgis.analysis.QgsGraphDirector

Base classes

QObject

Subclasses

QgsVectorLayerDirector

Determine making the graph from vector line layer

Methods

addStrategy

Add optimization strategy

makeGraph

Make a graph using QgsGraphBuilder

name

Returns director name

class qgis.analysis.QgsGraphDirector[source]

Bases: QObject

addStrategy(self, prop: QgsNetworkStrategy | None)[source]

Add optimization strategy

Parameters:

prop (Optional[QgsNetworkStrategy])

makeGraph(self, builder: QgsGraphBuilderInterface | None, additionalPoints: Iterable[QgsPointXY], feedback: QgsFeedback | None = None) List[QgsPointXY][source]

Make a graph using QgsGraphBuilder

Parameters:
  • builder (Optional[QgsGraphBuilderInterface]) – the graph builder

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

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

Note

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

Return type:

List[QgsPointXY]

Returns:

list of snapped points

name(self) str[source]

Returns director name

Return type:

str