QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
22 QString QgsBoundingBoxAlgorithm::name()
const
24 return QStringLiteral(
"boundingboxes" );
27 QString QgsBoundingBoxAlgorithm::displayName()
const
29 return QObject::tr(
"Bounding boxes" );
32 QStringList QgsBoundingBoxAlgorithm::tags()
const
34 return QObject::tr(
"bounding,boxes,envelope,rectangle,extent" ).split(
',' );
37 QString QgsBoundingBoxAlgorithm::group()
const
39 return QObject::tr(
"Vector geometry" );
42 QString QgsBoundingBoxAlgorithm::groupId()
const
44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsBoundingBoxAlgorithm::outputName()
const
49 return QObject::tr(
"Bounds" );
52 QString 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." );
59 QgsBoundingBoxAlgorithm *QgsBoundingBoxAlgorithm::createInstance()
const
61 return new QgsBoundingBoxAlgorithm();
67 fields.
append(
QgsField( QStringLiteral(
"width" ), QVariant::Double, QString(), 20, 6 ) );
68 fields.
append(
QgsField( QStringLiteral(
"height" ), QVariant::Double, QString(), 20, 6 ) );
69 fields.
append(
QgsField( QStringLiteral(
"area" ), QVariant::Double, QString(), 20, 6 ) );
70 fields.
append(
QgsField( QStringLiteral(
"perimeter" ), QVariant::Double, QString(), 20, 6 ) );
83 attrs << bounds.
width()
double perimeter() const SIP_HOLDGIL
Returns the perimeter of the rectangle.
double height() const SIP_HOLDGIL
Returns the height of the rectangle.
Base class for providing feedback from a processing algorithm.
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)
A rectangle specified with double values.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
double area() const SIP_HOLDGIL
Returns the area of the rectangle.
Contains information about the context in which a processing algorithm is executed.
QList< QgsFeature > QgsFeatureList
A geometry is the spatial representation of a feature.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
static QgsGeometry fromRect(const QgsRectangle &rect) SIP_HOLDGIL
Creates a new geometry from a QgsRectangle.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
Encapsulate a field in an attribute table or data source.