Skip to content

Commit 859ac16

Browse files
committedOct 15, 2018
Make maxOverlapArea parameter of overlap check optional
1 parent 32c71b8 commit 859ac16

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void QgsGeometryOverlapCheck::collectErrors( const QMap<QString, QgsFeaturePool
6565
{
6666
QgsAbstractGeometry *interPart = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart );
6767
double area = interPart->area();
68-
if ( area > mContext->reducedTolerance && area < mOverlapThresholdMapUnits )
68+
if ( area > mContext->reducedTolerance && ( area < mOverlapThresholdMapUnits || mOverlapThresholdMapUnits == 0.0 ) )
6969
{
7070
errors.append( new QgsGeometryOverlapCheckError( this, layerFeatureA, QgsGeometry( interPart->clone() ), interPart->centroid(), area, layerFeatureB ) );
7171
}

‎src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck
7575

7676
enum ResolutionMethod { Subtract, NoChange };
7777

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

0 commit comments

Comments
 (0)
Please sign in to comment.