Class: QgsPolygon¶
-
class
qgis.core.
QgsPolygon
¶ Bases:
QgsCurvePolygon
Polygon geometry type.
Methods
- param ring
- rtype
QByteArray
- rtype
QgsAbstractGeometry
- rtype
QgsPolygon
- rtype
QgsPolygon
- param wkb
- rtype
str
Returns the distance from a point to the boundary of the polygon (either the exterior ring or any closer interior rings).
- param ring
- rtype
QgsPolygon
Returns the geometry converted to the more generic curve type
QgsCurvePolygon
-
asWkb
(self) → QByteArray¶ - Return type
QByteArray
-
boundary
(self) → QgsAbstractGeometry¶ - Return type
-
calculateBoundingBox
()¶
-
childCount
()¶
-
childGeometry
()¶
-
childPoint
()¶
-
clear
(self)¶
-
clearCache
()¶
-
clone
(self) → QgsPolygon¶ - Return type
-
createEmptyWithSameType
(self) → QgsPolygon¶ - Return type
-
fromWkb
(self, wkb: QgsConstWkbPtr) → bool¶ - Parameters
wkb (QgsConstWkbPtr) –
- Return type
bool
-
geometryType
(self) → str¶ - Return type
str
-
hasChildGeometries
()¶
-
pointDistanceToBoundary
(self, x: float, y: float) → float¶ Returns the distance from a point to the boundary of the polygon (either the exterior ring or any closer interior rings). The returned distance will be negative if the point lies outside the polygon.
New in version 3.0.
- Parameters
x (float) –
y (float) –
- Return type
float
-
setZMTypeFromSubGeometry
()¶
-
surfaceToPolygon
(self) → QgsPolygon¶ - Return type
-
toCurveType
(self) → QgsCurvePolygon¶ Returns the geometry converted to the more generic curve type
QgsCurvePolygon
- Return type
- Returns
the converted geometry. Caller takes ownership*