Class: QgsGraphBuilder

class qgis.analysis.QgsGraphBuilder

Bases: QgsGraphBuilderInterface

This class used for making the QgsGraph object

QgsGraphBuilder(crs: QgsCoordinateReferenceSystem, otfEnabled: bool = True, topologyTolerance: float = 0, ellipsoidID: str = ‘’) Default constructor

Methods

addEdge

param pt1id

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.

addEdge(self, pt1id: int, pt1: QgsPointXY, pt2id: int, pt2: QgsPointXY, prop: Iterable[Any])
Parameters
  • pt1id (int) –

  • pt1 (QgsPointXY) –

  • pt2id (int) –

  • pt2 (QgsPointXY) –

  • prop (Iterable[Any]) –

addVertex(self, id: int, pt: QgsPointXY)

MANDATORY BUILDER PROPERTY DECLARATION

Parameters
graph(self)QgsGraph

Returns the generated QgsGraph.

The builder is left in its current state.

See also

takeGraph()

Return type

QgsGraph

takeGraph(self)QgsGraph

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

New in version 3.22.

Return type

QgsGraph