Subgroup: Curve
Class: QgsCurvePolygon¶
-
class
qgis.core.
QgsCurvePolygon
¶ Bases:
qgis._core.QgsSurface
Curve polygon geometry typeNew in version 2.10: Methods
Signals
Attributes
-
addInteriorRing
(self, ring: QgsCurve)¶ Adds an interior ring to the geometry (takes ownership)
-
addMValue
(self, mValue: float = 0) → bool¶
-
addZValue
(self, zValue: float = 0) → bool¶
-
adjacentVertices
(self, vertex: QgsVertexId) → Tuple[QgsVertexId, QgsVertexId]¶
-
area
(self) → float¶
-
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¶
-
boundary
(self) → QgsAbstractGeometry¶
-
calculateBoundingBox
(self) → QgsRectangle¶
-
childCount
(self) → int¶
-
childGeometry
(self, index: int) → QgsAbstractGeometry¶
-
childPoint
()¶
-
clear
(self)¶
-
clearCache
()¶
-
clone
(self) → QgsCurvePolygon¶
-
closestSegment
(self, pt: QgsPoint, epsilon: float = 4*DBL_EPSILON) → Tuple[float, QgsPoint, QgsVertexId, int]¶
-
coordinateSequence
(self) → object¶
-
createEmptyWithSameType
(self) → QgsCurvePolygon¶
-
deleteVertex
(self, position: QgsVertexId) → bool¶
-
dimension
(self) → int¶
-
draw
(self, p: QPainter)¶
-
dropMValue
(self) → bool¶
-
dropZValue
(self) → bool¶
-
exteriorRing
(self) → QgsCurve¶
-
fromWkb
(self, wkb: QgsConstWkbPtr) → bool¶
-
fromWkt
(self, wkt: str) → bool¶
-
geometryType
(self) → str¶
-
hasChildGeometries
()¶
-
hasCurvedSegments
(self) → bool¶
-
insertVertex
(self, position: QgsVertexId, vertex: QgsPoint) → bool¶
-
interiorRing
(self, i: int) → QgsCurve¶
-
isEmpty
(self) → bool¶
-
moveVertex
(self, position: QgsVertexId, newPos: QgsPoint) → bool¶
-
nCoordinates
(self) → int¶
-
nextVertex
(self, id: QgsVertexId) → Tuple[bool, QgsPoint]¶
-
numInteriorRings
(self) → int¶
-
partCount
(self) → int¶
-
perimeter
(self) → float¶
-
removeDuplicateNodes
(self, epsilon: float = 4*DBL_EPSILON, useZValues: bool = False) → bool¶
-
removeInteriorRing
(self, ringIndex: int) → bool¶ Removes an interior ring from the polygon. The first interior ring has index 0. The corresponding ring is removed from the polygon and deleted. If a ring was successfully removed the function will return true. It is not possible to remove the exterior ring using this method.
See also
-
removeInteriorRings
(self, minimumAllowedArea: float = -1)¶ Removes the interior rings from the polygon. If the minimumAllowedArea parameter is specified then only rings smaller than this minimum area will be removed.
New in version 3.0.
See also
-
ringCount
(self, part: int = 0) → int¶
-
segmentLength
(self, startVertex: QgsVertexId) → float¶
-
segmentize
(self, tolerance: float = M_PI_2/90, toleranceType: QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) → QgsAbstractGeometry¶ Returns a geometry without curves. Caller takes ownership
Parameters: - tolerance – segmentation tolerance
- toleranceType – maximum segmentation angle or maximum difference between approximation and curve*
-
setExteriorRing
(self, ring: QgsCurve)¶ Sets the exterior ring of the polygon. The CurvePolygon type will be updated to match the dimensionality of the exterior ring. For instance, setting a 2D exterior ring on a 3D CurvePolygon will drop the z dimension from the CurvePolygon and all interior rings.
Parameters: ring – new exterior ring. Ownership is transferred to the CurvePolygon. See also
See also
-
setInteriorRings
(self, rings: object)¶ Sets all interior rings (takes ownership)
-
setZMTypeFromSubGeometry
()¶
-
snappedToGrid
(self, hSpacing: float, vSpacing: float, dSpacing: float = 0, mSpacing: float = 0) → QgsCurvePolygon¶
-
surfaceToPolygon
(self) → QgsPolygon¶
-
toCurveType
(self) → QgsCurvePolygon¶
-
toPolygon
(self, tolerance: float = M_PI_2/90, toleranceType: QgsAbstractGeometry.SegmentationToleranceType = QgsAbstractGeometry.MaximumAngle) → QgsPolygon¶ Returns a new polygon geometry corresponding to a segmentized approximation of the curve.
Parameters: - tolerance – segmentation tolerance
- toleranceType – maximum segmentation angle or maximum difference between approximation and curve*
-
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¶ Returns approximate rotation angle for a vertex. Usually average angle between adjacent segments.
Parameters: vertex – the vertex id Returns: rotation in radians, clockwise from north
-
vertexAt
(self, id: QgsVertexId) → QgsPoint¶
-
vertexCount
(self, part: int = 0, ring: int = 0) → int¶
-
vertexNumberFromVertexId
(self, id: QgsVertexId) → int¶
-