22QString QgsBoundingBoxAlgorithm::name()
const
24 return QStringLiteral(
"boundingboxes" );
27QString QgsBoundingBoxAlgorithm::displayName()
const
29 return QObject::tr(
"Bounding boxes" );
32QStringList QgsBoundingBoxAlgorithm::tags()
const
34 return QObject::tr(
"bounding,boxes,envelope,rectangle,extent" ).split(
',' );
37QString QgsBoundingBoxAlgorithm::group()
const
39 return QObject::tr(
"Vector geometry" );
42QString QgsBoundingBoxAlgorithm::groupId()
const
44 return QStringLiteral(
"vectorgeometry" );
47QString QgsBoundingBoxAlgorithm::outputName()
const
49 return QObject::tr(
"Bounds" );
52QString QgsBoundingBoxAlgorithm::shortHelpString()
const
54 return QObject::tr(
"This algorithm calculates the bounding box (envelope) for each feature in an input layer." ) +
55 QStringLiteral(
"\n\n" ) +
56 QObject::tr(
"See the 'Minimum bounding geometry' algorithm for a bounding box calculation which covers the whole layer or grouped subsets of features." );
59QgsBoundingBoxAlgorithm *QgsBoundingBoxAlgorithm::createInstance()
const
61 return new QgsBoundingBoxAlgorithm();
67 fields.
append(
QgsField( QStringLiteral(
"width" ), QMetaType::Type::Double, QString(), 20, 6 ) );
68 fields.
append(
QgsField( QStringLiteral(
"height" ), QMetaType::Type::Double, QString(), 20, 6 ) );
69 fields.
append(
QgsField( QStringLiteral(
"area" ), QMetaType::Type::Double, QString(), 20, 6 ) );
70 fields.
append(
QgsField( QStringLiteral(
"perimeter" ), QMetaType::Type::Double, QString(), 20, 6 ) );
83 attrs << bounds.
width()
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.
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.
static QgsGeometry fromRect(const QgsRectangle &rect)
Creates a new geometry from a QgsRectangle.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
A rectangle specified with double values.
QList< QgsFeature > QgsFeatureList