53 void clear() override;
57 QString
asWkt(
int precision = 17 ) const override;
98 return static_cast<const QgsPolygon *
>( geom );
127 SIP_PYOBJECT __repr__();
129 QString wkt = sipCpp->asWkt();
130 if ( wkt.length() > 1000 )
131 wkt = wkt.left( 1000 ) + QStringLiteral(
"..." );
132 QString str = QStringLiteral(
"<QgsPolygon: %1>" ).arg( wkt );
133 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
WkbType
The WKB type describes the number of dimensions a geometry has.
QFlags< WkbFlag > WkbFlags
Qgis::WkbType wkbType() const
Returns the WKB type of the geometry.
QgsAbstractGeometry()=default
QgsCurvePolygon * createEmptyWithSameType() const override
Creates a new geometry with the same class and same WKB type as the original and transfers ownership.
Abstract base class for curved geometry type.
Line string geometry type, with support for z-dimension and m-values.
QgsCurvePolygon * toCurveType() const override
Returns the geometry converted to the more generic curve type QgsCurvePolygon.
static const QgsPolygon * cast(const QgsAbstractGeometry *geom)
Cast the geom to a QgsPolygon.
QgsPolygon(QgsLineString *exterior, const QList< QgsLineString * > &rings=QList< QgsLineString * >())
Constructor for QgsPolygon, with the specified exterior ring and interior rings.
void setExteriorRing(QgsCurve *ring) override
Sets the exterior ring of the polygon.
void addInteriorRing(QgsCurve *ring) override
Adds an interior ring to the geometry (takes ownership).
int wkbSize(QgsAbstractGeometry::WkbFlags flags=QgsAbstractGeometry::WkbFlags()) const override
Returns the length of the QByteArray returned by asWkb().
QByteArray asWkb(QgsAbstractGeometry::WkbFlags flags=QgsAbstractGeometry::WkbFlags()) const override
Returns a WKB representation of the geometry.
QgsPolygon * clone() const override
Clones the geometry by performing a deep copy.
void clear() override
Clears the geometry, ie reset it to a null geometry.
QString geometryType() const override
Returns a unique string representing the geometry type.
double pointDistanceToBoundary(double x, double y) const
Returns the distance from a point to the boundary of the polygon (either the exterior ring or any clo...
QgsAbstractGeometry * boundary() const override
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the...
friend class QgsCurvePolygon
QgsPolygon()
Constructor for an empty polygon geometry.
bool fromWkb(QgsConstWkbPtr &wkb) override
Sets the geometry from a WKB string.
QgsPolygon * surfaceToPolygon() const override
Gets a polygon representation of this surface.
QString asWkt(int precision=17) const override
Returns a WKT representation of the geometry.
static QgsPolygon * cast(QgsAbstractGeometry *geom)
Cast the geom to a QgsPolygon.
static Qgis::WkbType flatType(Qgis::WkbType type)
Returns the flat type for a WKB type.