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 = std::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 );