Class: QgsGraphBuilderInterface¶
- class qgis.analysis.QgsGraphBuilderInterface¶
Bases:
sip.wrapper
Determine interface for creating a graph. Contains the settings of the graph.
QgsGraphBuilder
andQgsGraphDirector
both use a “builder” design patternQgsGraphBuilderInterface(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
Add edge to the graph
Add vertex to the graph
Returns coordinate transformation enabled
Returns destinaltion CRS
Returns measurement tool
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
- distanceArea(self) QgsDistanceArea ¶
Returns measurement tool
- Return type
- topologyTolerance(self) float ¶
Returns topology tolerance
- Return type
float