22 QString QgsRemoveHolesAlgorithm::name()
const 24 return QStringLiteral(
"deleteholes" );
27 QString QgsRemoveHolesAlgorithm::displayName()
const 29 return QObject::tr(
"Delete holes" );
32 QStringList QgsRemoveHolesAlgorithm::tags()
const 34 return QObject::tr(
"remove,delete,drop,holes,rings,fill" ).split(
',' );
37 QString QgsRemoveHolesAlgorithm::group()
const 39 return QObject::tr(
"Vector geometry" );
42 QString QgsRemoveHolesAlgorithm::groupId()
const 44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsRemoveHolesAlgorithm::outputName()
const 49 return QObject::tr(
"Cleaned" );
52 QList<int> QgsRemoveHolesAlgorithm::inputLayerTypes()
const 62 QString 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." );
71 QgsRemoveHolesAlgorithm *QgsRemoveHolesAlgorithm::createInstance()
const 73 return new QgsRemoveHolesAlgorithm();
82 void QgsRemoveHolesAlgorithm::initParameters(
const QVariantMap & )
84 std::unique_ptr< QgsProcessingParameterNumber > minArea = qgis::make_unique< QgsProcessingParameterNumber >( QStringLiteral(
"MIN_AREA" ),
87 minArea->setIsDynamic(
true );
89 minArea->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
90 addParameter( minArea.release() );
95 mMinArea = parameterAsDouble( parameters, QStringLiteral(
"MIN_AREA" ), context );
97 if ( mDynamicMinArea )
98 mMinAreaProperty = parameters.value( QStringLiteral(
"MIN_AREA" ) ).value<
QgsProperty >();
110 double minArea = mMinArea;
111 if ( mDynamicMinArea )
112 minArea = mMinAreaProperty.valueAsDouble( context.
expressionContext(), minArea );
Base class for providing feedback from a processing algorithm.
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
QgsGeometry removeInteriorRings(double minimumAllowedArea=-1) const
Removes the interior rings from a (multi)polygon geometry.
QList< QgsFeature > QgsFeatureList
A geometry is the spatial representation of a feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Positive double value (including 0)
bool hasGeometry() const
Returns true if the feature has an associated geometry.
QgsGeometry geometry() const
Returns the geometry associated with this feature.
A store for object properties.
QgsExpressionContext & expressionContext()
Returns the expression context.
Definition for a property.
Flag
Flags controlling how QgsProcessingFeatureSource fetches features.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
SourceType
Data source types enum.
Contains information about the context in which a processing algorithm is executed.
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...