Class: QgsGraphBuilder

This class used for making the QgsGraph object

Class Hierarchy

Inheritance diagram of qgis.analysis.QgsGraphBuilder

Base classes

QgsGraphBuilderInterface

Determine interface for creating a graph. Contains the settings of the graph. QgsGraphBuilder and QgsGraphDirector both use a “builder” design pattern

Methods

addVertex

MANDATORY BUILDER PROPERTY DECLARATION

graph

Returns the generated QgsGraph.

takeGraph

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

class qgis.analysis.QgsGraphBuilder[source]

Bases: QgsGraphBuilderInterface

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

Default constructor

Parameters:
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]