22 QString QgsMinimumEnclosingCircleAlgorithm::name()
const 24 return QStringLiteral(
"minimumenclosingcircle" );
27 QString QgsMinimumEnclosingCircleAlgorithm::displayName()
const 29 return QObject::tr(
"Minimum enclosing circles" );
32 QStringList QgsMinimumEnclosingCircleAlgorithm::tags()
const 34 return QObject::tr(
"minimum,circle,ellipse,extent,bounds,bounding" ).split(
',' );
37 QString QgsMinimumEnclosingCircleAlgorithm::group()
const 39 return QObject::tr(
"Vector geometry" );
42 QString QgsMinimumEnclosingCircleAlgorithm::groupId()
const 44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsMinimumEnclosingCircleAlgorithm::outputName()
const 49 return QObject::tr(
"Minimum enclosing circles" );
57 void QgsMinimumEnclosingCircleAlgorithm::initParameters(
const QVariantMap & )
60 72,
false, 8, 100000 ) );
63 QString QgsMinimumEnclosingCircleAlgorithm::shortHelpString()
const 65 return QObject::tr(
"This algorithm calculates the minimum enclosing circle which covers each feature in an input layer." ) +
66 QStringLiteral(
"\n\n" ) +
67 QObject::tr(
"See the 'Minimum bounding geometry' algorithm for a minimal enclosing circle calculation which covers the whole layer or grouped subsets of features." );
70 QgsMinimumEnclosingCircleAlgorithm *QgsMinimumEnclosingCircleAlgorithm::createInstance()
const 72 return new QgsMinimumEnclosingCircleAlgorithm();
75 QgsFields QgsMinimumEnclosingCircleAlgorithm::outputFields(
const QgsFields &inputFields )
const 78 fields.
append(
QgsField( QStringLiteral(
"radius" ), QVariant::Double, QString(), 20, 6 ) );
79 fields.
append(
QgsField( QStringLiteral(
"area" ), QVariant::Double, QString(), 20, 6 ) );
85 mSegments = parameterAsInt( parameters, QStringLiteral(
"SEGMENTS" ), context );
100 << M_PI *radius *radius;
Base class for providing feedback from a processing algorithm.
QList< QgsFeature > QgsFeatureList
A class to represent a 2D point.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsGeometry minimalEnclosingCircle(QgsPointXY ¢er, double &radius, unsigned int segments=36) const
Returns the minimal enclosing circle for the geometry.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
Type
The WKB type describes the number of dimensions a geometry has.
bool append(const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1)
Append a field. The field must have unique name, otherwise it is rejected (returns false) ...
Encapsulate a field in an attribute table or data source.
QgsGeometry geometry() const
Returns the geometry associated with this feature.
A numeric parameter for processing algorithms.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
Contains information about the context in which a processing algorithm is executed.