Skip to content
Permalink
Browse files

Natural Breaks (Jenks) classification causes crash (#42618)

  • Loading branch information
tomass authored and nyalldawson committed Apr 7, 2021
1 parent 523510c commit 8322e800993f0e04f6d4e7a62731263da55963fc
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/classification/qgsclassificationjenks.cpp
@@ -99,10 +99,11 @@ QList<double> QgsClassificationJenks::calculateBreaks( double &minimum, double &

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
double r = QRandomGenerator::global()->generate();
int j = std::floor( r / QRandomGenerator::max() * ( values.size() - 1 ) );
#else
double r = qrand();
#endif
int j = std::floor( r / RAND_MAX * ( values.size() - 1 ) );
#endif
sample[ i ] = values[ j ];
}
}

0 comments on commit 8322e80

Please sign in to comment.