Class: QgsGraphBuilder

Used for making the QgsGraph object.

Class Hierarchy

Inheritance diagram of qgis.analysis.QgsGraphBuilder

Base classes

QgsGraphBuilderInterface

Interface for creating a graph.

Methods

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.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsGraphBuilder. See the FAQ for more details.

addVertex

MANDATORY BUILDER PROPERTY DECLARATION

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]