Class: QgsCompoundCurve¶
Compound curve geometry type
Class Hierarchy¶
Base classes¶
Abstract base class for curved geometry type  | 
|
Abstract base class for all geometries  | 
Methods
Adds a curve to the geometry (takes ownership).  | 
|
Adds a vertex to the end of the geometry.  | 
|
Appends first point if not already closed.  | 
|
Condenses the curves in this geometry by combining adjacent linestrings a to a single continuous linestring, and combining adjacent circularstrings to a single continuous circularstring.  | 
|
Returns the curve at the specified index.  | 
|
Returns a new line string geometry corresponding to a segmentized approximation of the curve.  | 
|
Returns the number of curves in the geometry.  | 
|
Removes a curve from the geometry.  | 
|
Converts the vertex at the given position from/to circular  | 
- class qgis.core.QgsCompoundCurve[source]¶
 Bases:
QgsCurve- addCurve(self, c: QgsCurve | None, extendPrevious: bool = False)[source]¶
 Adds a curve to the geometry (takes ownership).
Since QGIS 3.20, if
extendPreviousisTrue, then adding a LineString when the last existing curve in the compound curve is also a LineString will cause the existing linestring to be extended with the newly added LineString vertices instead of appending a whole new LineString curve to the compound curve. This can result in simplified compound curves with lesser number of component curves while still being topologically identical to the desired result.- Parameters:
 c (Optional[QgsCurve])
extendPrevious (bool = False)
- addVertex(self, pt: QgsPoint)[source]¶
 Adds a vertex to the end of the geometry.
- Parameters:
 pt (QgsPoint)
- condenseCurves(self)[source]¶
 Condenses the curves in this geometry by combining adjacent linestrings a to a single continuous linestring, and combining adjacent circularstrings to a single continuous circularstring.
Added in version 3.20.
- curveAt(self, i: int) QgsCurve | None[source]¶
 Returns the curve at the specified index.
- Parameters:
 i (int)
- Return type:
 Optional[QgsCurve]
- curveToLine(self, tolerance: float = M_PI_2 / 90, toleranceType: QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) QgsLineString | None[source]¶
 Returns a new line string geometry corresponding to a segmentized approximation of the curve.
- Parameters:
 tolerance (float = M_PI_2/90) – segmentation tolerance
toleranceType (QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) – maximum segmentation angle or maximum difference between approximation and curve
- Return type:
 Optional[QgsLineString]
- removeCurve(self, i: int)[source]¶
 Removes a curve from the geometry.
- Parameters:
 i (int) – index of curve to remove
- toggleCircularAtVertex(self, position: QgsVertexId) bool[source]¶
 Converts the vertex at the given position from/to circular
- Return type:
 bool
- Returns:
 Falseif atVertex does not correspond to a valid vertex on this geometry (including if this geometry is a Point), or if the specified vertex can’t be converted (e.g. start/end points).
Added in version 3.20.
- Parameters:
 position (QgsVertexId)