Skip to content

Commit

Permalink
[Geometry checker] Ensure overlap check returns on error for each ove…
Browse files Browse the repository at this point in the history
…rlap part
  • Loading branch information
manisandro committed Oct 23, 2017
1 parent 87cdeda commit 58e39f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -54,10 +54,11 @@ void QgsGeometryOverlapCheck::collectErrors( QList<QgsGeometryCheckError *> &err
QgsGeometryCheckerUtils::filter1DTypes( interGeom );
for ( int iPart = 0, nParts = interGeom->partCount(); iPart < nParts; ++iPart )
{
double area = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart )->area();
QgsAbstractGeometry *interPart = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart );
double area = interPart->area();
if ( area > mContext->reducedTolerance && area < overlapThreshold )
{
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() ) ) );
errors.append( new QgsGeometryOverlapCheckError( this, layerFeatureA, interPart->clone(), interPart->centroid(), area, layerFeatureB ) );
}
}
}
Expand Down
Expand Up @@ -22,14 +22,13 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
{
public:
QgsGeometryOverlapCheckError( const QgsGeometryCheck *check,
const QString &layerId,
QgsFeatureId featureId,
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
QgsAbstractGeometry *geometry,
const QgsPointXY &errorLocation,
const QVariant &value,
const QPair<QString, QgsFeatureId> &overlappedFeature )
: QgsGeometryCheckError( check, layerId, featureId, geometry, errorLocation, QgsVertexId(), value, ValueArea )
, mOverlappedFeature( overlappedFeature )
const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature )
: QgsGeometryCheckError( check, layerFeature.layer().id(), layerFeature.feature().id(), geometry, errorLocation, QgsVertexId(), value, ValueArea )
, mOverlappedFeature( qMakePair( overlappedFeature.layer().id(), overlappedFeature.feature().id() ) )
{ }
const QPair<QString, QgsFeatureId> &overlappedFeature() const { return mOverlappedFeature; }

Expand Down

0 comments on commit 58e39f6

Please sign in to comment.