23 QString QgsMinimumEnclosingCircleAlgorithm::name()
const 25 return QStringLiteral(
"minimumenclosingcircle" );
28 QString QgsMinimumEnclosingCircleAlgorithm::displayName()
const 30 return QObject::tr(
"Minimum enclosing circles" );
33 QStringList QgsMinimumEnclosingCircleAlgorithm::tags()
const 35 return QObject::tr(
"minimum,circle,ellipse,extent,bounds,bounding" ).split(
',' );
38 QString QgsMinimumEnclosingCircleAlgorithm::group()
const 40 return QObject::tr(
"Vector geometry" );
43 QString QgsMinimumEnclosingCircleAlgorithm::groupId()
const 45 return QStringLiteral(
"vectorgeometry" );
48 QString QgsMinimumEnclosingCircleAlgorithm::outputName()
const 50 return QObject::tr(
"Minimum enclosing circles" );
55 return QgsWkbTypes::Type::Polygon;
58 void QgsMinimumEnclosingCircleAlgorithm::initParameters(
const QVariantMap & )
61 72,
false, 8, 100000 ) );
64 QString QgsMinimumEnclosingCircleAlgorithm::shortHelpString()
const 66 return QObject::tr(
"This algorithm calculates the minimum enclosing circle which covers each feature in an input layer." ) +
67 QStringLiteral(
"\n\n" ) +
68 QObject::tr(
"See the 'Minimum bounding geometry' algorithm for a minimal enclosing circle calculation which covers the whole layer or grouped subsets of features." );
71 QgsMinimumEnclosingCircleAlgorithm *QgsMinimumEnclosingCircleAlgorithm::createInstance()
const 73 return new QgsMinimumEnclosingCircleAlgorithm();
76 bool QgsMinimumEnclosingCircleAlgorithm::supportInPlaceEdit(
const QgsMapLayer *l )
const 88 QgsFields QgsMinimumEnclosingCircleAlgorithm::outputFields(
const QgsFields &inputFields )
const 91 fields.
append(
QgsField( QStringLiteral(
"radius" ), QVariant::Double, QString(), 20, 6 ) );
92 fields.
append(
QgsField( QStringLiteral(
"area" ), QVariant::Double, QString(), 20, 6 ) );
98 mSegments = parameterAsInt( parameters, QStringLiteral(
"SEGMENTS" ), context );
113 << M_PI *radius *radius;
Base class for all map layer types.
Base class for providing feedback from a processing algorithm.
QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
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...
static bool hasZ(Type type)
Tests whether a WKB type contains the z-dimension.
Type
The WKB type describes the number of dimensions a geometry has.
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) ...
Encapsulate a field in an attribute table or data source.
A numeric parameter for processing algorithms.
QgsGeometry minimalEnclosingCircle(QgsPointXY ¢er, double &radius, unsigned int segments=36) const
Returns the minimal enclosing circle for the geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
bool supportInPlaceEdit(const QgsMapLayer *layer) const override
Checks whether this algorithm supports in-place editing on the given layer Default implementation for...
static bool hasM(Type type)
Tests whether a WKB type contains m values.
Represents a vector layer which manages a vector based data sets.
Contains information about the context in which a processing algorithm is executed.