Skip to content
Permalink
Browse files

Merge pull request #8901 from mhugo/release-3_4

IndexExtent fix
  • Loading branch information
Hugo Mercier
Hugo Mercier committed Jan 18, 2019
2 parents 355820a + adb5998 commit 2797f3a7eba88adc2cf23e48b4ac4e32ce99d173
Showing with 5 additions and 2 deletions.
  1. +1 −1 src/app/vertextool/qgsvertextool.cpp
  2. +4 −1 src/core/qgssnappingutils.cpp
@@ -982,7 +982,7 @@ QgsGeometry QgsVertexTool::cachedGeometry( const QgsVectorLayer *layer, QgsFeatu
{
const bool layerWasNotInCache = !mCache.contains( layer );
// insert if it was not in cache
QHash<QgsFeatureId, QgsGeometry>& layerCache = mCache[layer];
QHash<QgsFeatureId, QgsGeometry> &layerCache = mCache[layer];
if ( layerWasNotInCache )
{
connect( layer, &QgsVectorLayer::geometryChanged, this, &QgsVertexTool::onCachedGeometryChanged );
@@ -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 2797f3a

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