Subgroup: other

Class: QgsCompoundCurve

class qgis.core.QgsCompoundCurve

Bases: qgis._core.QgsCurve

Compound curve geometry type

New in version 2.10: Methods

addCurve Adds a curve to the geometry (takes ownership)
addMValue
addToPainterPath
addVertex Adds a vertex to the end of the geometry.
addZValue
adjacentVertices
area Returns the area of the geometry.
asGml2
asGml3
asJson
asQPolygonF Returns a QPolygonF representing the points.
asWkb
asWkt
boundary
boundingBox
calculateBoundingBox
centroid Returns the centroid of the geometry
childCount
childGeometry
childPoint
clear
clearCache
clone
close Appends first point if not already closed.
closestSegment
convertTo Converts the geometry to a specified type.
coordinateSequence
createEmptyWithSameType
curveAt Returns the curve at the specified index.
curveToLine Returns a new line string geometry corresponding to a segmentized approximation of the curve.
deleteVertex
dimension
draw
drawAsPolygon
dropMValue
dropZValue
endPoint
equals
fromWkb
fromWkt
geometryType
hasChildGeometries
hasCurvedSegments
insertVertex
is3D Returns true if the geometry is 3D and contains a z-value.
isClosed Returns true if the curve is closed.
isEmpty
isMeasure Returns true if the geometry contains m values.
isRing Returns true if the curve is a ring.
length
moveVertex
nCoordinates Returns the number of nodes contained in the geometry
nCurves Returns the number of curves in the geometry.
nextVertex
numPoints
partCount
perimeter Returns the perimeter of the geometry.
pointAt
points
removeCurve Removes a curve from the geometry.
removeDuplicateNodes
reversed
ringCount
segmentLength
segmentize Returns a geometry without curves.
setZMTypeFromSubGeometry
snappedToGrid
startPoint
sumUpArea
toCurveType
transform transform(self, t: QTransform, zTranslate: float = 0, zScale: float = 1, mTranslate: float = 0, mScale: float = 1)
vertexAngle
vertexAt
vertexCount
vertexNumberFromVertexId
vertices Returns Java-style iterator for traversal of vertices of the geometry
wkbType Returns the WKB type of the geometry.
wktTypeStr Returns the WKT type string of the geometry.
xAt
yAt

Attributes

MaximumAngle
MaximumDifference
addCurve(self, c: QgsCurve)

Adds a curve to the geometry (takes ownership)

addMValue(self, mValue: float = 0) → bool
addToPainterPath(self, path: QPainterPath)
addVertex(self, pt: QgsPoint)

Adds a vertex to the end of the geometry.

addZValue(self, zValue: float = 0) → bool
asGml2(self, doc: QDomDocument, precision: int = 17, ns: str = '') → QDomElement
asGml3(self, doc: QDomDocument, precision: int = 17, ns: str = '') → QDomElement
asJson(self, precision: int = 17) → str
asWkb(self) → QByteArray
asWkt(self, precision: int = 17) → str
calculateBoundingBox(self) → QgsRectangle
childCount()
childGeometry()
childPoint()
clear(self)
clearCache()
clone(self) → QgsCompoundCurve
close(self)

Appends first point if not already closed.

closestSegment(self, pt: QgsPoint, epsilon: float = 4*DBL_EPSILON) → Tuple[float, QgsPoint, QgsVertexId, int]
createEmptyWithSameType(self) → QgsCompoundCurve
curveAt(self, i: int) → QgsCurve

Returns the curve at the specified index.

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 – segmentation tolerance
  • toleranceType – maximum segmentation angle or maximum difference between approximation and curve*
deleteVertex(self, position: QgsVertexId) → bool
dimension(self) → int
draw(self, p: QPainter)
drawAsPolygon(self, p: QPainter)
dropMValue(self) → bool
dropZValue(self) → bool
endPoint(self) → QgsPoint
equals(self, other: QgsCurve) → bool
fromWkb(self, wkb: QgsConstWkbPtr) → bool
fromWkt(self, wkt: str) → bool
geometryType(self) → str
hasChildGeometries()
hasCurvedSegments(self) → bool
insertVertex(self, position: QgsVertexId, vertex: QgsPoint) → bool
isEmpty(self) → bool
length(self) → float
moveVertex(self, position: QgsVertexId, newPos: QgsPoint) → bool
nCurves(self) → int

Returns the number of curves in the geometry.

numPoints(self) → int
pointAt(self, node: int, point: QgsPoint) → Tuple[bool, QgsVertexId.VertexType]
points(self) → object
removeCurve(self, i: int)

Removes a curve from the geometry.

Parameters:i – index of curve to remove
removeDuplicateNodes(self, epsilon: float = 4*DBL_EPSILON, useZValues: bool = False) → bool
reversed(self) → QgsCompoundCurve
segmentLength(self, startVertex: QgsVertexId) → float
setZMTypeFromSubGeometry()
snappedToGrid(self, hSpacing: float, vSpacing: float, dSpacing: float = 0, mSpacing: float = 0) → QgsCompoundCurve
startPoint(self) → QgsPoint
sumUpArea(self) → float
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)

vertexAngle(self, vertex: QgsVertexId) → float
xAt(self, index: int) → float
yAt(self, index: int) → float