22QString QgsConvexHullAlgorithm::name()
const
24 return QStringLiteral(
"convexhull" );
27QString QgsConvexHullAlgorithm::displayName()
const
29 return QObject::tr(
"Convex hull" );
32QStringList QgsConvexHullAlgorithm::tags()
const
34 return QObject::tr(
"convex,hull,bounds,bounding" ).split(
',' );
37QString QgsConvexHullAlgorithm::group()
const
39 return QObject::tr(
"Vector geometry" );
42QString QgsConvexHullAlgorithm::groupId()
const
44 return QStringLiteral(
"vectorgeometry" );
47QString QgsConvexHullAlgorithm::outputName()
const
49 return QObject::tr(
"Convex hulls" );
52QString QgsConvexHullAlgorithm::shortHelpString()
const
54 return QObject::tr(
"This algorithm calculates the convex hull for each feature in an input layer." ) + QStringLiteral(
"\n\n" ) + QObject::tr(
"See the 'Minimum bounding geometry' algorithm for a convex hull calculation which covers the whole layer or grouped subsets of features." );
57QgsConvexHullAlgorithm *QgsConvexHullAlgorithm::createInstance()
const
59 return new QgsConvexHullAlgorithm();
65 fields.
append(
QgsField( QStringLiteral(
"area" ), QMetaType::Type::Double, QString(), 20, 6 ) );
66 fields.
append(
QgsField( QStringLiteral(
"perimeter" ), QMetaType::Type::Double, QString(), 20, 6 ) );
78 feedback->
reportError( QObject::tr(
"Cannot calculate convex hull for a single Point feature (try 'Minimum bounding geometry' algorithm instead)." ) );
84 if ( outputGeometry.
isNull() )
88 if ( !outputGeometry.
isNull() )
virtual double perimeter() const
Returns the planar, 2-dimensional perimeter of the geometry.
virtual double area() const
Returns the planar, 2-dimensional area of the geometry.
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.
void clearGeometry()
Removes any geometry associated with the feature.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
bool append(const QgsField &field, Qgis::FieldOrigin origin=Qgis::FieldOrigin::Provider, int originIndex=-1)
Appends a field.
A geometry is the spatial representation of a feature.
QString lastError() const
Returns an error string referring to the last error encountered either when this geometry was created...
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
QgsGeometry convexHull() const
Returns the smallest convex polygon that contains all the points in the geometry.
Qgis::WkbType wkbType() const
Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
virtual void reportError(const QString &error, bool fatalError=false)
Reports that the algorithm encountered an error while executing.
static Qgis::WkbType flatType(Qgis::WkbType type)
Returns the flat type for a WKB type.
QList< QgsFeature > QgsFeatureList