Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #720 from Oslandia/issue6483
Fix #6483 - Thanks Vincent!
  • Loading branch information
timlinux committed Sep 15, 2013
2 parents a1a95c1 + 6e31245 commit 7e171ef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
Expand Up @@ -482,6 +482,15 @@ void QgsGraduatedSymbolRendererV2Widget::classifyGraduated()
else // default should be quantile for now
mode = QgsGraduatedSymbolRendererV2::Quantile;


// Jenks is n^2 complexity, warn for big dataset (more than 50k records)
// and give the user the chance to cancel
if ( QgsGraduatedSymbolRendererV2::Jenks == mode
&& mLayer->featureCount() > 50000 )
{
if ( QMessageBox::Cancel == QMessageBox::question( this, tr( "Warning" ), tr( "Natural break classification (Jenks) is O(n2) complexity, your classification may take a long time.\nPress cancel to abort breaks calculation or OK to continue." ), QMessageBox::Cancel, QMessageBox::Ok ) ) return;
}

// create and set new renderer
QApplication::setOverrideCursor( Qt::WaitCursor );
QgsGraduatedSymbolRendererV2* r = QgsGraduatedSymbolRendererV2::createRenderer(
Expand Down

0 comments on commit 7e171ef

Please sign in to comment.