Skip to content
Permalink
Browse files

Merge pull request #39997 from m-kuhn/distance_is_faster

Distance is faster than finding shared edge
  • Loading branch information
m-kuhn committed Nov 12, 2020
2 parents e4b209d + 52a99f9 commit 3679e9d933c935827610b0f778053a77540425e2
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 3679e9d

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