Class: QgsGraphBuilderInterface

class qgis.analysis.QgsGraphBuilderInterface

Bases: sip.wrapper

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

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

Parameters
  • crs – Coordinate reference system for new graph vertex

  • ctfEnabled – enable coordinate transform from source graph CRS to CRS graph

  • topologyTolerance – sqrt distance between source point as one graph vertex

  • ellipsoidID – ellipsoid for edge measurement

QgsGraphBuilderInterface(QgsGraphBuilderInterface)

Methods

addEdge

Add edge to the graph

addVertex

Add vertex to the graph

coordinateTransformationEnabled

Returns coordinate transformation enabled

destinationCrs

Returns destinaltion CRS

distanceArea

Returns measurement tool

topologyTolerance

Returns topology tolerance

addEdge(self, pt1id: int, pt1: QgsPointXY, pt2id: int, pt2: QgsPointXY, strategies: Iterable[Any])

Add edge to the graph

Parameters
  • pt1id (int) – first vertex identificator

  • pt1 (QgsPointXY) – first vertex coordinates

  • pt2id (int) – second vertex identificator

  • pt2 (QgsPointXY) – second vertex coordinates

  • strategies (Iterable[Any]) – optimization strategies

Note

pt1id, pt1 and pt2id, pt2 is a redundant interface. You can use vertex coordinates or their identificators.

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

Add vertex to the graph

Parameters
  • id (int) – vertex identifier

  • pt (QgsPointXY) – vertex coordinates

Note

id and pt are redundant. You can use pt or id to identify the vertex

coordinateTransformationEnabled(self)bool

Returns coordinate transformation enabled

Return type

bool

destinationCrs(self)QgsCoordinateReferenceSystem

Returns destinaltion CRS

Return type

QgsCoordinateReferenceSystem

distanceArea(self)QgsDistanceArea

Returns measurement tool

Return type

QgsDistanceArea

topologyTolerance(self)float

Returns topology tolerance

Return type

float