QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
22 QString QgsConvexHullAlgorithm::name()
const
24 return QStringLiteral(
"convexhull" );
27 QString QgsConvexHullAlgorithm::displayName()
const
29 return QObject::tr(
"Convex hull" );
32 QStringList QgsConvexHullAlgorithm::tags()
const
34 return QObject::tr(
"convex,hull,bounds,bounding" ).split(
',' );
37 QString QgsConvexHullAlgorithm::group()
const
39 return QObject::tr(
"Vector geometry" );
42 QString QgsConvexHullAlgorithm::groupId()
const
44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsConvexHullAlgorithm::outputName()
const
49 return QObject::tr(
"Convex hulls" );
52 QString QgsConvexHullAlgorithm::shortHelpString()
const
54 return QObject::tr(
"This algorithm calculates the convex hull for each feature in an input layer." ) +
55 QStringLiteral(
"\n\n" ) +
56 QObject::tr(
"See the 'Minimum bounding geometry' algorithm for a convex hull calculation which covers the whole layer or grouped subsets of features." );
59 QgsConvexHullAlgorithm *QgsConvexHullAlgorithm::createInstance()
const
61 return new QgsConvexHullAlgorithm();
67 fields.
append(
QgsField( QStringLiteral(
"area" ), QVariant::Double, QString(), 20, 6 ) );
68 fields.
append(
QgsField( QStringLiteral(
"perimeter" ), QVariant::Double, QString(), 20, 6 ) );
80 feedback->
reportError( QObject::tr(
"Cannot calculate convex hull for a single Point feature (try 'Minimum bounding geometry' algorithm instead)." ) );
86 if ( outputGeometry.
isNull() )
90 if ( !outputGeometry.
isNull() )
QString lastError() const SIP_HOLDGIL
Returns an error string referring to the last error encountered either when this geometry was created...
Base class for providing feedback from a processing algorithm.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.
Container of fields for a vector layer.
bool append(const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1)
Appends a field. The field must have unique name, otherwise it is rejected (returns false)
void clearGeometry()
Removes any geometry associated with the feature.
virtual double area() const
Returns the planar, 2-dimensional area of the geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Contains information about the context in which a processing algorithm is executed.
QgsGeometry convexHull() const
Returns the smallest convex polygon that contains all the points in the geometry.
QList< QgsFeature > QgsFeatureList
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
A geometry is the spatial representation of a feature.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
virtual double perimeter() const
Returns the planar, 2-dimensional perimeter of the geometry.
A vector of attributes. Mostly equal to QVector<QVariant>.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
Encapsulate a field in an attribute table or data source.