Class: QgsCompoundCurve¶
-
class
qgis.core.
QgsCompoundCurve
¶ Bases:
QgsCurve
Compound curve geometry type
Methods
Adds a curve to the geometry (takes ownership)
- param mValue
- param path
Adds a vertex to the end of the geometry.
- param zValue
- param doc
- param doc
- rtype
QByteArray
- param precision
- rtype
QgsRectangle
Returns pointer to child geometry (for geometries with child geometries - i.e.
- rtype
QgsCompoundCurve
Appends first point if not already closed.
- param pt
- rtype
QgsCompoundCurve
Returns the curve at the specified index.
- param startDistance
Returns a new line string geometry corresponding to a segmentized approximation of the curve.
- param position
- rtype
int
- param p
- param p
- rtype
bool
- rtype
bool
- rtype
QgsPoint
- param other
- param wkb
- param wkt
- rtype
str
Returns whether the geometry has any child geometries (
False
for point / curve,True
otherwise)- rtype
bool
- param position
- param distance
- rtype
bool
- rtype
float
- param position
Returns the number of curves in the geometry.
- rtype
int
- param node
- rtype
List[QgsPoint]
Removes a curve from the geometry.
- param epsilon
- rtype
QgsCompoundCurve
- param startVertex
Updates the geometry type based on whether sub geometries contain z or m values.
- param hSpacing
- rtype
QgsPoint
- rtype
float
transform(self, t: QTransform, zTranslate: float = 0, zScale: float = 1, mTranslate: float = 0, mScale: float = 1)
- param vertex
- param index
- param index
-
addCurve
(self, c: QgsCurve)¶ Adds a curve to the geometry (takes ownership)
- Parameters
c (QgsCurve) –
-
addMValue
(self, mValue: float = 0) → bool¶ - Parameters
mValue (float = 0) –
- Return type
bool
-
addToPainterPath
(self, path: QPainterPath)¶ - Parameters
path (QPainterPath) –
-
addZValue
(self, zValue: float = 0) → bool¶ - Parameters
zValue (float = 0) –
- Return type
bool
-
asGml2
(self, doc: QDomDocument, precision: int = 17, ns: str = '', axisOrder: QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) → QDomElement¶ - Parameters
doc (QDomDocument) –
precision (int = 17) –
ns (str = '') –
axisOrder (QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) –
- Return type
QDomElement
-
asGml3
(self, doc: QDomDocument, precision: int = 17, ns: str = '', axisOrder: QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) → QDomElement¶ - Parameters
doc (QDomDocument) –
precision (int = 17) –
ns (str = '') –
axisOrder (QgsAbstractGeometry.AxisOrder = QgsAbstractGeometry.AxisOrder.XY) –
- Return type
QDomElement
-
asWkb
(self) → QByteArray¶ - Return type
QByteArray
-
asWkt
(self, precision: int = 17) → str¶ - Parameters
precision (int = 17) –
- Return type
str
-
calculateBoundingBox
(self) → QgsRectangle¶ - Return type
-
childCount
(self) → int¶
-
childGeometry
(self, index: int) → QgsAbstractGeometry¶ Returns pointer to child geometry (for geometries with child geometries - i.e. geom. collection / polygon)
Note
used for vertex_iterator implementation
New in version 3.0.
-
clear
(self)¶
-
clearCache
(self)¶
-
clone
(self) → QgsCompoundCurve¶ - Return type
-
close
(self)¶ Appends first point if not already closed.
-
closestSegment
(self, pt: QgsPoint, epsilon: float = 4 * DBL_EPSILON) → Tuple[float, QgsPoint, QgsVertexId, int]¶ - Parameters
pt (QgsPoint) –
epsilon (float = 4*DBL_EPSILON) –
- Return type
Tuple[float,
QgsPoint
,QgsVertexId
, int]
-
createEmptyWithSameType
(self) → QgsCompoundCurve¶ - Return type
-
curveAt
(self, i: int) → QgsCurve¶ Returns the curve at the specified index.
- Parameters
i (int) –
- Return type
-
curveSubstring
(self, startDistance: float, endDistance: float) → QgsCompoundCurve¶ - Parameters
startDistance (float) –
endDistance (float) –
- Return type
-
curveToLine
(self, tolerance: float = M_PI_2 / 90, toleranceType: QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) → QgsLineString¶ 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
-
deleteVertex
(self, position: QgsVertexId) → bool¶ - Parameters
position (QgsVertexId) –
- Return type
bool
-
dimension
(self) → int¶ - Return type
int
-
draw
(self, p: QPainter)¶ - Parameters
p (QPainter) –
-
drawAsPolygon
(self, p: QPainter)¶ - Parameters
p (QPainter) –
-
dropMValue
(self) → bool¶ - Return type
bool
-
dropZValue
(self) → bool¶ - Return type
bool
-
fromWkb
(self, wkb: QgsConstWkbPtr) → bool¶ - Parameters
wkb (QgsConstWkbPtr) –
- Return type
bool
-
fromWkt
(self, wkt: str) → bool¶ - Parameters
wkt (str) –
- Return type
bool
-
geometryType
(self) → str¶ - Return type
str
-
hasChildGeometries
(self) → bool¶ Returns whether the geometry has any child geometries (
False
for point / curve,True
otherwise)Note
used for vertex_iterator implementation
New in version 3.0.
-
hasCurvedSegments
(self) → bool¶ - Return type
bool
-
insertVertex
(self, position: QgsVertexId, vertex: QgsPoint) → bool¶ - Parameters
position (QgsVertexId) –
vertex (QgsPoint) –
- Return type
bool
-
isEmpty
(self) → bool¶ - Return type
bool
-
length
(self) → float¶ - Return type
float
-
moveVertex
(self, position: QgsVertexId, newPos: QgsPoint) → bool¶ - Parameters
position (QgsVertexId) –
newPos (QgsPoint) –
- Return type
bool
-
nCurves
(self) → int¶ Returns the number of curves in the geometry.
- Return type
int
-
numPoints
(self) → int¶ - Return type
int
-
pointAt
(self, node: int, point: QgsPoint) → Tuple[bool, QgsVertexId.VertexType]¶ - Parameters
node (int) –
point (QgsPoint) –
- Return type
Tuple[bool, QgsVertexId.VertexType]
-
removeCurve
(self, i: int)¶ Removes a curve from the geometry.
- Parameters
i (int) – index of curve to remove
-
removeDuplicateNodes
(self, epsilon: float = 4 * DBL_EPSILON, useZValues: bool = False) → bool¶ - Parameters
epsilon (float = 4*DBL_EPSILON) –
useZValues (bool = False) –
- Return type
bool
-
reversed
(self) → QgsCompoundCurve¶ - Return type
-
segmentLength
(self, startVertex: QgsVertexId) → float¶ - Parameters
startVertex (QgsVertexId) –
- Return type
float
-
setZMTypeFromSubGeometry
(self, subggeom: QgsAbstractGeometry, baseGeomType: QgsWkbTypes.Type)¶ Updates the geometry type based on whether sub geometries contain z or m values.
-
snappedToGrid
(self, hSpacing: float, vSpacing: float, dSpacing: float = 0, mSpacing: float = 0) → QgsCompoundCurve¶ - Parameters
hSpacing (float) –
vSpacing (float) –
dSpacing (float = 0) –
mSpacing (float = 0) –
- Return type
-
sumUpArea
(self) → float¶ - Return type
float
-
swapXy
(self)¶
-
transform
(self, ct: QgsCoordinateTransform, d: QgsCoordinateTransform.TransformDirection = QgsCoordinateTransform.ForwardTransform, transformZ: bool = False)¶ transform(self, t: QTransform, zTranslate: float = 0, zScale: float = 1, mTranslate: float = 0, mScale: float = 1)
- Parameters
ct (QgsCoordinateTransform) –
d (QgsCoordinateTransform.TransformDirection = QgsCoordinateTransform.ForwardTransform) –
transformZ (bool = False) –
-
vertexAngle
(self, vertex: QgsVertexId) → float¶ - Parameters
vertex (QgsVertexId) –
- Return type
float
-
xAt
(self, index: int) → float¶ - Parameters
index (int) –
- Return type
float
-
yAt
(self, index: int) → float¶ - Parameters
index (int) –
- Return type
float