Class: QgsGraphBuilder

Used for making the QgsGraph object.

Class Hierarchy

Inheritance diagram of qgis.analysis.QgsGraphBuilder

Base classes

QgsGraphBuilderInterface

Interface for creating a graph.

class qgis.analysis.QgsGraphBuilder[source]

Bases: QgsGraphBuilderInterface

__init__(crs: QgsCoordinateReferenceSystem, otfEnabled: bool = True, topologyTolerance: float = 0, ellipsoidID: str | None = '')

Default constructor

Parameters:
virtual addVertex(self, id: int, pt: QgsPointXY)[source]

MANDATORY BUILDER PROPERTY DECLARATION

Parameters:
graph(self) QgsGraph[source]

Returns the generated QgsGraph.

The builder is left in its current state.

See also

takeGraph()

Return type:

QgsGraph

takeGraph(self) QgsGraph | None[source]

Takes the generated graph from the builder, resetting the builder back to its initial state ready for additional graph construction.

Added in version 3.22.

Return type:

Optional[QgsGraph]