mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Much faster zoom to selection on large PostGIS layers
This commit is contained in:
parent
33fe0e2d49
commit
6772ffb97d
@ -619,19 +619,18 @@ QgsRectangle QgsVectorLayer::boundingBoxOfSelected()
|
||||
QgsFeature fet;
|
||||
if ( mDataProvider->capabilities() & QgsVectorDataProvider::SelectAtId )
|
||||
{
|
||||
Q_FOREACH ( QgsFeatureId fid, mSelectedFeatureIds )
|
||||
{
|
||||
if ( getFeatures( QgsFeatureRequest()
|
||||
.setFilterFid( fid )
|
||||
.setSubsetOfAttributes( QgsAttributeList() ) )
|
||||
.nextFeature( fet ) &&
|
||||
fet.constGeometry() )
|
||||
QgsFeatureIterator fit = getFeatures( QgsFeatureRequest()
|
||||
.setFilterFids( mSelectedFeatureIds )
|
||||
.setSubsetOfAttributes( QgsAttributeList() ) );
|
||||
|
||||
while ( fit.nextFeature( fet ) )
|
||||
{
|
||||
if ( !fet.constGeometry() || fet.constGeometry()->isEmpty() )
|
||||
continue;
|
||||
r = fet.constGeometry()->boundingBox();
|
||||
retval.combineExtentWith( &r );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsFeatureIterator fit = getFeatures( QgsFeatureRequest()
|
||||
|
Loading…
x
Reference in New Issue
Block a user