Skip to content
Permalink
Browse files

Much faster zoom to selection on large PostGIS layers

  • Loading branch information
nyalldawson committed Nov 5, 2015
1 parent 33fe0e2 commit 6772ffb97d9985b8e17aacb13dab6ce0812312b0
Showing with 9 additions and 10 deletions.
  1. +9 −10 src/core/qgsvectorlayer.cpp
@@ -619,17 +619,16 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
QgsFeature fet;
if ( mDataProvider->capabilities() & QgsVectorDataProvider::SelectAtId )
{
Q_FOREACH ( QgsFeatureId fid, mSelectedFeatureIds )
QgsFeatureIterator fit = getFeatures( QgsFeatureRequest()
.setFilterFids( mSelectedFeatureIds )
.setSubsetOfAttributes( QgsAttributeList() ) );

while ( fit.nextFeature( fet ) )
{
if ( getFeatures( QgsFeatureRequest()
.setFilterFid( fid )
.setSubsetOfAttributes( QgsAttributeList() ) )
.nextFeature( fet ) &&
fet.constGeometry() )
{
r = fet.constGeometry()->boundingBox();
retval.combineExtentWith( &r );
}
if ( !fet.constGeometry() || fet.constGeometry()->isEmpty() )
continue;
r = fet.constGeometry()->boundingBox();
retval.combineExtentWith( &r );
}
}
else

0 comments on commit 6772ffb

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