Skip to content

Commit

Permalink
Make maxOverlapArea parameter of overlap check optional
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent 32c71b8 commit 859ac16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -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 ) );
}
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit 859ac16

Please sign in to comment.