Class: QgsCompoundCurve¶
Compound curve geometry type.
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Abstract base class for curved geometry type. |
|
Abstract base class for all geometries. |
Abstract Methods
Returns a new line string geometry corresponding to a segmentized approximation of the curve. |
|
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 the number of curves in the geometry. |
|
Removes a curve from the geometry. |
|
Converts the vertex at the given position from/to circular |
Virtual Methods
In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsCompoundCurve. See the FAQ for more details.
- 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 (QgsCurve|None)
extendPrevious (bool = False)
- addVertex(self, pt: QgsPoint)[source]¶
Adds a vertex to the end of the geometry.
- Parameters:
pt (QgsPoint)
- abstract clone(self) QgsCompoundCurve | None[source]¶
- Return type:
QgsCompoundCurve|None
- 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.
- virtual createEmptyWithSameType(self) QgsCompoundCurve | None[source]¶
- Return type:
QgsCompoundCurve|None
- curveAt(self, i: int) QgsCurve | None[source]¶
Returns the curve at the specified index.
- Parameters:
i (int)
- Return type:
QgsCurve|None
- abstract curveSubstring(self, startDistance: float, endDistance: float) QgsCompoundCurve | None[source]¶
- Parameters:
startDistance (float)
endDistance (float)
- Return type:
QgsCompoundCurve|None
- abstract 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:
QgsLineString|None
- abstract interpolatePoint(self, distance: float) QgsPoint | None[source]¶
- Parameters:
distance (float)
- Return type:
QgsPoint|None
- removeCurve(self, i: int)[source]¶
Removes a curve from the geometry.
- Parameters:
i (int) – index of curve to remove
- abstract reversed(self) QgsCompoundCurve | None[source]¶
- Return type:
QgsCompoundCurve|None
- virtual simplifiedTypeRef(self) QgsAbstractGeometry | None[source]¶
- Return type:
QgsAbstractGeometry|None
- virtual simplifyByDistance(self, tolerance: float) QgsAbstractGeometry | None[source]¶
- Parameters:
tolerance (float)
- Return type:
QgsAbstractGeometry|None
- virtual snappedToGrid(self, hSpacing: float, vSpacing: float, dSpacing: float = 0, mSpacing: float = 0, removeRedundantPoints: bool = False) QgsCompoundCurve | None[source]¶
- Parameters:
hSpacing (float)
vSpacing (float)
dSpacing (float = 0)
mSpacing (float = 0)
removeRedundantPoints (bool = False)
- Return type:
QgsCompoundCurve|None
- 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)