Skip to content
Permalink
Browse files

Merge pull request #40018 from qgis-bot/backport-39997-to-release-3_16

[Backport release-3_16] Distance is faster than finding shared edge
  • Loading branch information
m-kuhn committed Nov 14, 2020
2 parents 6a5dd46 + dbae397 commit 220b4a03701166875720121c839e5e857022fd8b
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/analysis/vector/geometry_checker/qgsgeometrygapcheck.cpp
@@ -171,7 +171,7 @@ void QgsGeometryGapCheck::collectErrors( const QMap<QString, QgsFeaturePool *> &
for ( const QgsGeometryCheckerUtils::LayerFeature &layerFeature : layerFeatures )
{
const QgsGeometry geom = layerFeature.geometry();
if ( gapGeomEngine->distance( geom.constGet() ) < mContext->tolerance && QgsGeometryCheckerUtils::sharedEdgeLength( gapGeom, geom.constGet(), mContext->reducedTolerance ) > 0 )
if ( gapGeomEngine->distance( geom.constGet() ) < mContext->tolerance )
{
neighboringIds[layerFeature.layer()->id()].insert( layerFeature.feature().id() );
gapAreaBBox.combineExtentWith( geom.boundingBox() );
@@ -349,7 +349,9 @@ bool QgsGeometryGapCheck::mergeWithNeighbor( const QMap<QString, QgsFeaturePool
break;

case LargestArea:
val = QgsGeometryCheckerUtils::getGeomPart( testGeom, iPart )->area();
// We might get a neighbour where we touch only a corner
if ( QgsGeometryCheckerUtils::sharedEdgeLength( errLayerGeom.get(), QgsGeometryCheckerUtils::getGeomPart( testGeom, iPart ), mContext->reducedTolerance ) > 0 )
val = QgsGeometryCheckerUtils::getGeomPart( testGeom, iPart )->area();
break;
}

0 comments on commit 220b4a0

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