22QString QgsRemoveHolesAlgorithm::name()
const
24 return QStringLiteral(
"deleteholes" );
27QString QgsRemoveHolesAlgorithm::displayName()
const
29 return QObject::tr(
"Delete holes" );
32QStringList QgsRemoveHolesAlgorithm::tags()
const
34 return QObject::tr(
"remove,delete,drop,holes,rings,fill" ).split(
',' );
37QString QgsRemoveHolesAlgorithm::group()
const
39 return QObject::tr(
"Vector geometry" );
42QString QgsRemoveHolesAlgorithm::groupId()
const
44 return QStringLiteral(
"vectorgeometry" );
47QString QgsRemoveHolesAlgorithm::outputName()
const
49 return QObject::tr(
"Cleaned" );
52QList<int> QgsRemoveHolesAlgorithm::inputLayerTypes()
const
62QString QgsRemoveHolesAlgorithm::shortHelpString()
const
64 return QObject::tr(
"This algorithm takes a polygon layer and removes holes in polygons. It creates a new vector "
65 "layer in which polygons with holes have been replaced by polygons with only their external ring. "
66 "Attributes are not modified.\n\n"
67 "An optional minimum area parameter allows removing only holes which are smaller than a specified "
68 "area threshold. Leaving this parameter as 0.0 results in all holes being removed." );
71QgsRemoveHolesAlgorithm *QgsRemoveHolesAlgorithm::createInstance()
const
73 return new QgsRemoveHolesAlgorithm();
82void QgsRemoveHolesAlgorithm::initParameters(
const QVariantMap & )
84 std::unique_ptr<QgsProcessingParameterArea> minArea = std::make_unique<QgsProcessingParameterArea>( QStringLiteral(
"MIN_AREA" ), QObject::tr(
"Remove holes with area less than" ), 0.0, QStringLiteral(
"INPUT" ),
false, 0 );
85 minArea->setIsDynamic(
true );
87 minArea->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
88 addParameter( minArea.release() );
93 mMinArea = parameterAsDouble( parameters, QStringLiteral(
"MIN_AREA" ), context );
95 if ( mDynamicMinArea )
96 mMinAreaProperty = parameters.value( QStringLiteral(
"MIN_AREA" ) ).value<
QgsProperty>();
108 double minArea = mMinArea;
109 if ( mDynamicMinArea )
110 minArea = mMinAreaProperty.valueAsDouble( context.
expressionContext(), minArea );
ProcessingSourceType
Processing data source types.
@ VectorPolygon
Vector polygon layers.
@ SkipGeometryValidityChecks
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
QFlags< ProcessingFeatureSourceFlag > ProcessingFeatureSourceFlags
Flags which control how QgsProcessingFeatureSource fetches features.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
A geometry is the spatial representation of a feature.
QgsGeometry removeInteriorRings(double minimumAllowedArea=-1) const
Removes the interior rings from a (multi)polygon geometry.
Contains information about the context in which a processing algorithm is executed.
QgsExpressionContext & expressionContext()
Returns the expression context.
Base class for providing feedback from a processing algorithm.
static bool isDynamic(const QVariantMap ¶meters, const QString &name)
Returns true if the parameter with matching name is a dynamic parameter, and must be evaluated once f...
Definition for a property.
@ DoublePositive
Positive double value (including 0)
A store for object properties.
QList< QgsFeature > QgsFeatureList