Class: QgsGraph¶
-
class
qgis.analysis.
QgsGraph
¶ Bases:
sip.wrapper
Constructor for QgsGraph.
QgsGraph(QgsGraph)
Mathematical graph representation
New in version 3.0: Enums
Methods
Add an edge to the graph, going from the
fromVertexIdx
totoVertexIdx
.Add a vertex to the graph
Returns edge at given index
Returns number of graph edges
Find vertex by associated point
Returns vertex at given index
Returns number of graph vertices
Signals
Attributes
-
addEdge
(self, fromVertexIdx: int, toVertexIdx: int, strategies: Iterable[Any]) → int¶ Add an edge to the graph, going from the
fromVertexIdx
totoVertexIdx
.
-
addVertex
(self, pt: QgsPointXY) → int¶ Add a vertex to the graph
-
edge
(self, idx: int) → QgsGraphEdge¶ Returns edge at given index
-
edgeCount
(self) → int¶ Returns number of graph edges
-
findVertex
(self, pt: QgsPointXY) → int¶ Find vertex by associated point
- Returns
vertex index
-
vertex
(self, idx: int) → QgsGraphVertex¶ Returns vertex at given index
-
vertexCount
(self) → int¶ Returns number of graph vertices
-