Skip to content
Permalink
Browse files

IndexExtent fix

Backport from cd1f316
  • Loading branch information
Hugo Mercier
Hugo Mercier committed Jan 18, 2019
1 parent f99a911 commit c5512a4ba388613e115bd788431e5c567bdd4c5b
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/qgssnappingutils.cpp
@@ -89,9 +89,12 @@ bool QgsSnappingUtils::isIndexPrepared( QgsVectorLayer *vl, const QgsRectangle &
if ( mStrategy == IndexAlwaysFull && loc->hasIndex() )
return true;

if ( mStrategy == IndexExtent && loc->hasIndex() && loc->extent()->intersects( areaOfInterest ) )
return true;

QgsRectangle aoi( areaOfInterest );
aoi.scale( 0.999 );
return ( mStrategy == IndexHybrid || mStrategy == IndexExtent ) && loc->hasIndex() && ( !loc->extent() || loc->extent()->contains( aoi ) ); // the index - even if it exists - is not suitable
return mStrategy == IndexHybrid && loc->hasIndex() && ( !loc->extent() || loc->extent()->contains( aoi ) ); // the index - even if it exists - is not suitable
}

static QgsPointLocator::Match _findClosestSegmentIntersection( const QgsPointXY &pt, const QgsPointLocator::MatchList &segments )

0 comments on commit c5512a4

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