Skip to content
Permalink
Browse files

Make maxOverlapArea parameter of overlap check optional

  • Loading branch information
m-kuhn committed Oct 1, 2018
1 parent 32c71b8 commit 859ac16f3dcf0b60d4dde10c712249f0cf5f9f33
@@ -65,7 +65,7 @@ void QgsGeometryOverlapCheck::collectErrors( const QMap<QString, QgsFeaturePool
{
QgsAbstractGeometry *interPart = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart );
double area = interPart->area();
if ( area > mContext->reducedTolerance && area < mOverlapThresholdMapUnits )
if ( area > mContext->reducedTolerance && ( area < mOverlapThresholdMapUnits || mOverlapThresholdMapUnits == 0.0 ) )
{
errors.append( new QgsGeometryOverlapCheckError( this, layerFeatureA, QgsGeometry( interPart->clone() ), interPart->centroid(), area, layerFeatureB ) );
}
@@ -75,6 +75,14 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck

enum ResolutionMethod { Subtract, NoChange };

/**
* Checks for overlapping polygons.
*
* In \a configuration a maxOverlapArea parameter can be passed. In case this parameter is set
* to something else than 0.0, the error will only be reported if the overlapping area is smaller
* than maxOverlapArea.
* Overlapping areas smaller than the reducedTolerance parameter of the \a context are ignored.
*/
QgsGeometryOverlapCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration );
QList<QgsWkbTypes::GeometryType> compatibleGeometryTypes() const override { return factoryCompatibleGeometryTypes(); }
void collectErrors( const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors, QStringList &messages, QgsFeedback *feedback = nullptr, const LayerFeatureIds &ids = LayerFeatureIds() ) const override;

0 comments on commit 859ac16

Please sign in to comment.
You can’t perform that action at this time.