Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
vector layer: calculate extents lazily (fixes #9510)
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1685,10 +1685,10 @@ bool QgsVectorLayer::setDataProvider( QString const & provider ) | |
mValid = mDataProvider->isValid(); | ||
if ( mValid ) | ||
{ | ||
|
||
// TODO: Check if the provider has the capability to send fullExtentCalculated | ||
connect( mDataProvider, SIGNAL( fullExtentCalculated() ), this, SLOT( updateExtents() ) ); | ||
|
||
#if 0 // allow lazy calculation of extents and give the creator of the vector layer a chance to 'manually' setExtent | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
NathanW2
Member
|
||
// get the extent | ||
QgsRectangle mbr = mDataProvider->extent(); | ||
|
||
|
@@ -1697,6 +1697,7 @@ bool QgsVectorLayer::setDataProvider( QString const & provider ) | |
QgsDebugMsg( "Extent of layer: " + s ); | ||
// store the extent | ||
setExtent( mbr ); | ||
#endif | ||
|
||
// get and store the feature type | ||
mWkbType = mDataProvider->geometryType(); | ||
|
@@ -3693,7 +3694,7 @@ void QgsVectorLayer::readSldLabeling( const QDomNode& node ) | |
QDomElement userStyleElem = element.firstChildElement( "UserStyle" ); | ||
if ( userStyleElem.isNull() ) | ||
{ | ||
QgsDebugMsg( "Info: UserStyle element not found."); | ||
QgsDebugMsg( "Info: UserStyle element not found." ); | ||
return; | ||
} | ||
|
||
|
Hi @jef-n, disabling this code QGIS always reads all features to calculate the extent of the layer in QgsVectorLayer::extent().
It is very very slow for big vector layers.