Skip to content
Permalink
Browse files

[Geometry checker] Ensure overlap check returns on error for each ove…

…rlap part
  • Loading branch information
manisandro committed Sep 28, 2017
1 parent 87cdeda commit 58e39f6a065dc8e8cb5f45bb1f1bbb91dec74a68
@@ -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 ) );
}
}
}
@@ -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; }

0 comments on commit 58e39f6

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