mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[Geometry checker] Ensure overlap check returns on error for each overlap part
This commit is contained in:
parent
87cdeda439
commit
58e39f6a06
@ -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; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user