23QString QgsMinimumEnclosingCircleAlgorithm::name()
const
25 return QStringLiteral(
"minimumenclosingcircle" );
28QString QgsMinimumEnclosingCircleAlgorithm::displayName()
const
30 return QObject::tr(
"Minimum enclosing circles" );
33QStringList QgsMinimumEnclosingCircleAlgorithm::tags()
const
35 return QObject::tr(
"minimum,circle,ellipse,extent,bounds,bounding" ).split(
',' );
38QString QgsMinimumEnclosingCircleAlgorithm::group()
const
40 return QObject::tr(
"Vector geometry" );
43QString QgsMinimumEnclosingCircleAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeometry" );
48QString QgsMinimumEnclosingCircleAlgorithm::outputName()
const
50 return QObject::tr(
"Minimum enclosing circles" );
55 return QgsWkbTypes::Type::Polygon;
58void QgsMinimumEnclosingCircleAlgorithm::initParameters(
const QVariantMap & )
61 72,
false, 8, 100000 ) );
64QString 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." );
71QgsMinimumEnclosingCircleAlgorithm *QgsMinimumEnclosingCircleAlgorithm::createInstance()
const
73 return new QgsMinimumEnclosingCircleAlgorithm();
76bool QgsMinimumEnclosingCircleAlgorithm::supportInPlaceEdit(
const QgsMapLayer *l )
const
78 const QgsVectorLayer *layer = qobject_cast< const QgsVectorLayer * >( l );
88QgsFields 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;
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, FieldOrigin origin=OriginProvider, int originIndex=-1)
Appends a field. The field must have unique name, otherwise it is rejected (returns false)
A geometry is the spatial representation of a feature.
QgsGeometry minimalEnclosingCircle(QgsPointXY ¢er, double &radius, unsigned int segments=36) const
Returns the minimal enclosing circle for the geometry.
Base class for all map layer types.
A class to represent a 2D point.
Contains information about the context in which a processing algorithm is executed.
bool supportInPlaceEdit(const QgsMapLayer *layer) const override
Checks whether this algorithm supports in-place editing on the given layer Default implementation for...
Base class for providing feedback from a processing algorithm.
A numeric parameter for processing algorithms.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
static bool hasM(Type type) SIP_HOLDGIL
Tests whether a WKB type contains m values.
Type
The WKB type describes the number of dimensions a geometry has.
static bool hasZ(Type type) SIP_HOLDGIL
Tests whether a WKB type contains the z-dimension.
QList< QgsFeature > QgsFeatureList