Skip to content

Commit 58e39f6

Browse files
committedOct 23, 2017
[Geometry checker] Ensure overlap check returns on error for each overlap part
1 parent 87cdeda commit 58e39f6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ void QgsGeometryOverlapCheck::collectErrors( QList<QgsGeometryCheckError *> &err
5454
QgsGeometryCheckerUtils::filter1DTypes( interGeom );
5555
for ( int iPart = 0, nParts = interGeom->partCount(); iPart < nParts; ++iPart )
5656
{
57-
double area = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart )->area();
57+
QgsAbstractGeometry *interPart = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart );
58+
double area = interPart->area();
5859
if ( area > mContext->reducedTolerance && area < overlapThreshold )
5960
{
60-
errors.append( new QgsGeometryOverlapCheckError( this, layerFeatureA.layer().id(), layerFeatureA.feature().id(), interGeom->clone(), QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart )->centroid(), area, qMakePair( layerFeatureB.layer().id(), layerFeatureB.feature().id() ) ) );
61+
errors.append( new QgsGeometryOverlapCheckError( this, layerFeatureA, interPart->clone(), interPart->centroid(), area, layerFeatureB ) );
6162
}
6263
}
6364
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
2222
{
2323
public:
2424
QgsGeometryOverlapCheckError( const QgsGeometryCheck *check,
25-
const QString &layerId,
26-
QgsFeatureId featureId,
25+
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
2726
QgsAbstractGeometry *geometry,
2827
const QgsPointXY &errorLocation,
2928
const QVariant &value,
30-
const QPair<QString, QgsFeatureId> &overlappedFeature )
31-
: QgsGeometryCheckError( check, layerId, featureId, geometry, errorLocation, QgsVertexId(), value, ValueArea )
32-
, mOverlappedFeature( overlappedFeature )
29+
const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature )
30+
: QgsGeometryCheckError( check, layerFeature.layer().id(), layerFeature.feature().id(), geometry, errorLocation, QgsVertexId(), value, ValueArea )
31+
, mOverlappedFeature( qMakePair( overlappedFeature.layer().id(), overlappedFeature.feature().id() ) )
3332
{ }
3433
const QPair<QString, QgsFeatureId> &overlappedFeature() const { return mOverlappedFeature; }
3534

0 commit comments

Comments
 (0)
Please sign in to comment.