Subgroup: Curve
Class: QgsCurvePolygon¶
-
class
qgis.core.
QgsCurvePolygon
¶ Bases:
qgis._core.QgsSurface
Curve polygon geometry type
New in version 2.10: Methods
addInteriorRing
Adds an interior ring to the geometry (takes ownership) addMValue
addZValue
adjacentVertices
area
asGml2
asGml3
asJson
asWkb
asWkt
boundary
boundingBox
Returns the minimal bounding box for the geometry calculateBoundingBox
centroid
Returns the centroid of the geometry childCount
childGeometry
childPoint
clear
clearCache
clone
closestSegment
convertTo
Converts the geometry to a specified type. coordinateSequence
createEmptyWithSameType
deleteVertex
dimension
draw
dropMValue
dropZValue
exteriorRing
fromWkb
fromWkt
geometryType
hasChildGeometries
hasCurvedSegments
insertVertex
interiorRing
is3D
Returns true if the geometry is 3D and contains a z-value. isEmpty
isMeasure
Returns true if the geometry contains m values. length
Returns the length of the geometry. moveVertex
nCoordinates
nextVertex
numInteriorRings
partCount
perimeter
removeDuplicateNodes
removeInteriorRing
Removes an interior ring from the polygon. removeInteriorRings
Removes the interior rings from the polygon. ringCount
segmentLength
segmentize
Returns a geometry without curves. setExteriorRing
Sets the exterior ring of the polygon. setInteriorRings
Sets all interior rings (takes ownership) setZMTypeFromSubGeometry
snappedToGrid
surfaceToPolygon
toCurveType
toPolygon
Returns a new polygon geometry corresponding to a segmentized approximation of the curve. transform
transform(self, t: QTransform, zTranslate: float = 0, zScale: float = 1, mTranslate: float = 0, mScale: float = 1) vertexAngle
Returns approximate rotation angle for a vertex. 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. Attributes
MaximumAngle
MaximumDifference
-
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¶
-